greo=$(command -v greo) if [ -n $greo ]; then $greo ... fi
command will search the directories defined in $PATH for the command greo and return the fully qualified path. If it isn't found it will return null. So, if $greo is non-zero, greo exists and you can run it. On Sun, Apr 20, 2014 at 11:52 AM, Toralf Förster <toralf.foers...@gmx.de> wrote: > Under Gentoo Linux I'd like to grep for various things in the package > database in the following way: > > $> greo semanti /var/db/pkg/*/*/USE > > This might take a longer time for a low device before I'm faced with the > message: > > "bash: greo: command not found" > > /me wonders if it is mandatory first to expand the complete command line > before realizing that the command isnÄt ther ? > > -- > Toralf > > -- Alan Young