Re: semicolon at beginning of line

2012-04-10 Thread Clark Wang
On Tue, Apr 10, 2012 at 16:38, Elliott Forney wrote: > On Tue, Apr 10, 2012 at 1:22 AM, Maarten Billemont > wrote: > > People should stop trying to execute code by parameter expansion, and > specifically stop thinking that parameter-expanded words are evaluated as > bash code. > > I still think t

Re: semicolon at beginning of line

2012-04-10 Thread Elliott Forney
On Tue, Apr 10, 2012 at 1:22 AM, Maarten Billemont wrote: > People should stop trying to execute code by parameter expansion, and > specifically stop thinking that parameter-expanded words are evaluated as > bash code. I still think the behavior is interesting. The statement may not be empty b

Re: semicolon at beginning of line

2012-04-10 Thread Maarten Billemont
On 10 Apr 2012, at 06:03, Elliott Forney wrote: > Here is another example that appears to defy my expectations. In this > case, the semicolon is allowed: > > sine:~$ hello='echo hello' > sine:~$ world='echo world' > sine:~$ ${hello};${world} > hello > world > sine:~$ unset hello > sine:~$ ${hello

Re: semicolon at beginning of line

2012-04-09 Thread Elliott Forney
Here is another example that appears to defy my expectations. In this case, the semicolon is allowed: sine:~$ hello='echo hello' sine:~$ world='echo world' sine:~$ ${hello};${world} hello world sine:~$ unset hello sine:~$ ${hello};${world} world sine:~$ unset world sine:~$ ${hello};${world} Than

Re: semicolon at beginning of line

2012-04-09 Thread Elliott Forney
Sure, a comment can be used to place a line in your history but that doesn't really address the examples I had. Just seems to me like a lone semicolon could be treated as a newline/noop. I can't seem to think of anything that this would break but, of course, that doesn't mean it wouldn't. The en

Re: semicolon at beginning of line

2012-04-08 Thread Joseph Fredette
Could also use a #, no? On Sun, Apr 8, 2012 at 8:46 PM, Steven W. Orr wrote: > On 4/7/2012 4:00 PM, Elliott Forney wrote: > >> I wish bash would happily execute lines that begin with a semicolon, >> i.e., treat it as a no-op followed by a command. The following >> examples come to mind: >> >> $

Re: semicolon at beginning of line

2012-04-08 Thread Steven W. Orr
On 4/7/2012 4:00 PM, Elliott Forney wrote: I wish bash would happily execute lines that begin with a semicolon, i.e., treat it as a no-op followed by a command. The following examples come to mind: $ infloop& echo hello [2] 11361 hello $ infloop&; echo hello bash: syntax error near unexpected

Re: semicolon at beginning of line

2012-04-07 Thread Linda Walsh
Elliott Forney wrote: I wish bash would happily execute lines that begin with a semicolon, i.e., treat it as a no-op followed by a command. The following examples come to mind: $ infloop& echo hello hello $ infloop&; echo hello bash: syntax error near unexpected token `;' $ echo hello; ec

semicolon at beginning of line

2012-04-07 Thread Elliott Forney
I wish bash would happily execute lines that begin with a semicolon, i.e., treat it as a no-op followed by a command. The following examples come to mind: $ infloop& echo hello [2] 11361 hello $ infloop&; echo hello bash: syntax error near unexpected token `;' $ echo hello; echo world hello worl