[Linux-disciples] Equivalent bash syntaxes

Jamie Forrest jamie at honksandsirens.com
Mon Jul 21 11:37:55 EDT 2008


Does #1 allow for multiple actions?

On Jul 21, 2008, at 11:31 AM, Stephen R Laniel wrote:

> Is there any reason to prefer any of the
> following three forms to either of the
> other two?
>
> - test expression && action
>
> - if test expression; then
>      action
>  fi
>
> - if [ expression ]; then
>      action
>  fi
>
> I would guess that the versions
> featuring test(1) would be more
> portable, but I would also guess that
> most modern shells support the [ ... ]
> syntax. So is this a "six of one,
> half-dozen of another" thing?
>
> -- 
> Stephen R. Laniel
> steve at laniels.org
> Cell: +(617) 308-5571
> http://laniels.org/
> PGP key: http://laniels.org/slaniel.key
> _______________________________________________
> Linux-disciples mailing list
> Linux-disciples at lists.bostoncoop.net
> http://lists.bostoncoop.net/mailman/listinfo/linux-disciples
>



More information about the Linux-disciples mailing list