Re: `if $(cmd);' is a positive when there's no output from cmd

2006-04-16 Thread Andreas Schwab
Herculano Einloft [EMAIL PROTECTED] writes: Em (02:25:11), Andreas Schwab escreveu: Hey all, $ if $(echo string /dev/null); then echo true; fi true This should be a syntax error No, it is a perfectly valid command, syntactically. That the command substitution expands to

Re: `if $(cmd);' is a positive when there's no output from cmd

2006-04-15 Thread Andreas Schwab
Herculano Einloft [EMAIL PROTECTED] writes: Hey all, $ if $(echo string /dev/null); then echo true; fi true This should be a syntax error No, it is a perfectly valid command, syntactically. That the command substitution expands to nothing has no significance any more once the command

Re: `if $(cmd);' is a positive when there's no output from cmd

2006-04-15 Thread Mike Frysinger
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

Re: `if $(cmd);' is a positive when there's no output from cmd

2006-04-15 Thread Herculano Einloft
Em (21:43:32), Mike Frysinger escreveu: 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

Re: `if $(cmd);' is a positive when there's no output from cmd

2006-04-15 Thread Herculano Einloft
Em (02:25:11), Andreas Schwab escreveu: Herculano Einloft writes: Hey all, $ if $(echo string /dev/null); then echo true; fi true This should be a syntax error No, it is a perfectly valid command, syntactically. That the command substitution expands to nothing has no