Shell programming style -- a plea for better shell scripts

matt%ucla-locus at sri-unix.UUCP matt%ucla-locus at sri-unix.UUCP
Sun Feb 26 09:40:17 AEST 1984


From:            Matthew J. Weinstein <matt at ucla-locus>

Two notes:

	I believe that Bourne shell IS the default on a BSD system.  
	The #! may not be recognized on non-Berkeley systems.
	Better that it be added locally if it's wanted...

	If PATH varies among Unices, it might be better to define all 
	of the programs you are going to use at the top of the shell 
	script, as one does in make scripts; e.g.:
		SORT=/bin/sort		set SORT = /bin/sort
		SED=/bin/sed		set SED  = /bin/sed
	The owner of the target system can easily tell what has to be
	changed; this also makes the script writer think about it too...

Maybe there should be an ``Elements of Shell Programming Style'' ...

					- Matt



More information about the Comp.unix mailing list