bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: test for "command not found" before expanding shell parameters


From: Toralf Förster
Subject: Re: test for "command not found" before expanding shell parameters
Date: Sun, 20 Apr 2014 20:05:08 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 04/20/2014 07:58 PM, Alan Young wrote:
> 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.

If "greo" does not exist - will bash in that case expand /var/db/pkg/*/*/USE 
neverttheless ?



-- 
Toralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]