# HG changeset patch # User Pascal Bellard # Date 1569249544 -7200 # Node ID cf17791e53df76acfc59c0404abaa7d9ced4b622 # Parent c1eb003410dc5474617d926dd054809361f59e62 busybox: add command_not_found (again) diff -r c1eb003410dc -r cf17791e53df busybox/stuff/command_not_found --- a/busybox/stuff/command_not_found Mon Sep 23 15:30:05 2019 +0200 +++ b/busybox/stuff/command_not_found Mon Sep 23 16:39:04 2019 +0200 @@ -2,25 +2,20 @@ ZLIST=/var/lib/tazpkg/files.list.lzma LIST=/tmp/command-list +[ ! $LIST -nt $ZLIST ] && unlzma <$ZLIST | grep -E '(usr/games/|bin/)' >$LIST && chmod 666 $LIST -lookup() -{ +lookup() { grep -s "/$2$1$" $LIST | while read pkg file; do cat < $LIST -fi MSG="$(lookup "$1")" [ "$MSG" ] || MSG="$(lookup "$1" get-)" -[ "$MSG" ] || MSG="${SHELL##*/}: $1: not found" -echo "$MSG" +echo "${MSG:-${SHELL##*/}: $1: not found}"