On Tue, Sep 6, 2016 at 12:07 PM, Ali H. Fardan <[email protected]> wrote:
> one more thing, multiline vs one-line statements:
>
> if [ expr ... ]; then
> ...
> fi
>
> versus
>
> if [ expr ... ]
> then
> ...
> fi
>
> this applies to others as well:
>
> while [ expr ... ]
> do
> ...
> done
>
> I'd stick with the multiline style, what about you?
I tend to prefer single line. I equate them to the opening braces in
C, and I like being able to read more code at once on a screen.
if (foo) {
...
}
if [ "$foo" ]; then
...
fi