bug-bash
[Top][All Lists]
Advanced

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

Re: $(echo ': ;false') vs $(echo false)


From: Paul Jarc
Subject: Re: $(echo ': ;false') vs $(echo false)
Date: 06 Apr 2001 11:35:51 -0400
User-agent: Gnus/5.090001 (Oort Gnus v0.01) Emacs/20.7

address@hidden (Tom Rodman) writes:
> < not saying this is a bug..>
> Why does this happen?:
> 
>        > 09:25:45 Fri Apr  6    ~
>        > 1002 39 cmke787 rodmant > $(echo ': ; false') ; echo $?
>        0
>        > 09:30:32 Fri Apr  6    ~
>        > 1003 39 cmke787 rodmant > $(echo false) ; echo $?
>        1
> 
> How can I detect that "false" ran in the first example above?

It didn't.  In the first example, you ran the command ":" (which
always returns 0) with arguments ";" and "false" (which are ignored).
$() isn't the same as eval.  "eval ': ; false'" will do what you want.


paul



reply via email to

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