Re: `if $(cmd);' is a positive when there's no output from cmd
From:
Mike Frysinger
Subject:
Re: `if $(cmd);' is a positive when there's no output from cmd
Date:
Sat, 15 Apr 2006 21:43:32 -0400
User-agent:
KMail/1.9.1
On Saturday 15 April 2006 19:55, Herculano Einloft wrote:
> $ if $(echo string >/dev/null); then echo true; fi
> true
>
> This should be a syntax error, since
>
> $ if; then echo true; fi
> bash: syntax error near unexpected token `;'
the first command statement is more like:
if :; then echo true; fi
-mike