[TUHS] SH script formatting

David Barto david at kdbarto.org
Wed Sep 30 04:42:55 AEST 2020


In a brief discussion with a coworker today the question of formatting shell scripts came up.

I believed that in the past the preferred format (if there ever were any such thing) was

if [ test ]
then
	statements
else
	statements
fi

I can find nothing specific to back this up. More appropriate for COFF maybe would
be a discussion of what format is better

if [ test ]; then
	statements
else
	statements
fi

or the above.

No intention to start any kind of flame war about which is better, just want to see
if there is any historical option for one over the other.

	David


More information about the TUHS mailing list