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, syntac

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 &

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: > >> 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

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

2006-04-15 Thread Herculano Einloft
Hey all, $ 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 `;' Tested on GNU bash, version 2.05b.0(1)-release (i386-pc-linux-gnu) Copyright (C) 2002 Free Software Foundation, In