[kwlug-disc] Outsmarted by bash && if

Robert P. J. Day rpjday at crashcourse.ca
Thu Apr 8 04:36:06 EDT 2010


On Wed, 7 Apr 2010, John Johnson wrote:

> At 21:39 2010-04-07, you wrote:
> > Is the space before the ";" relevant?
>
> While my bash work was years ago, I think the ";" itself may be an issue.
> When placed before the "then" the semicolon terminates the following construct
> early:
> if <condition> then statement ;
>
> The semicolon essentially becomes a null statement

  no, it's just a statement separator.  i use it all the time so i can
write

  if blah ; then

rather than the more verbose

  if blah
  then

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================




More information about the kwlug-disc mailing list