wok diff busybox/stuff/command_not_found @ rev 21869
busybox/command_not_found: use $PATH
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Sep 25 10:59:33 2019 +0200 (2019-09-25) |
parents | cf17791e53df |
children | 7a22ba39ec41 |
line diff
1.1 --- a/busybox/stuff/command_not_found Mon Sep 23 16:39:04 2019 +0200 1.2 +++ b/busybox/stuff/command_not_found Wed Sep 25 10:59:33 2019 +0200 1.3 @@ -1,11 +1,12 @@ 1.4 #!/bin/sh 1.5 1.6 -ZLIST=/var/lib/tazpkg/files.list.lzma 1.7 -LIST=/tmp/command-list 1.8 -[ ! $LIST -nt $ZLIST ] && unlzma <$ZLIST | grep -E '(usr/games/|bin/)' >$LIST && chmod 666 $LIST 1.9 +FILES=/var/lib/tazpkg/files.list.lzma 1.10 +LIST=/tmp/command-list.gz 1.11 +[ ! $LIST -nt $FILES ] && unlzma <$FILES | \ 1.12 +grep -E "(: $(echo ${PATH//:/|: }))" | gzip -9 >$LIST && chmod 666 $LIST 1.13 1.14 lookup() { 1.15 - grep -s "/$2$1$" $LIST | while read pkg file; do 1.16 + zcat $LIST | grep "/$2$1$" | while read pkg file; do 1.17 cat <<EOT 1.18 Command '$1' not found, but can be installed as root with: 1.19