//Tips tagged test
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
Sometimes you want to find a program without knowing the full name. This can be done with the following one liner:

IFS=: ; for D in $PATH; do for F in $D/*PATTERN*; do [ -x $F ] && echo $F; done; done

For example:
$ IFS=: ; for D in $PATH; do for F in $D/*text*; do [ -x $F ] && echo $F; done; done
/usr/bin/gettext
/usr/bin/glib-gettextize
/usr/bin/gnome-text-editor
/usr/bin/xgettext


View Comments »



[ $[ $RANDOM % 6 ] == 0 ] && echo Die || echo Live

Of course you can always replace "echo Die" by something a bit more interesting, kill a process perhaps or 'rm -rf' :)


View Comments »




Home Latest Browse Top 25 Random Hall Of Fame Contact Submit