[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: multiple variable reference, etc.



> 	PS.  The Principle of Least Astonishment should be used with some
> 	care: It must be assumed that the user is reasonably well informed.
> 	For example, the novice Bourne shell user, having learned that the :
> 	command does nothing at all, might well be astonished to learn that
> 	
> 		: `rm -fr *`
> 	
> 	will indeed delete all his files, while it is the opposite behaviour
> 	that would more astonish a more seasoned user.

That's more ``the Bourne shell user who hasn't been taught properly''. Right
from the start I remember being told that : evaluates its arguments but does
nothing with them -- hence use of stuff like 

#!/bin/sh
: ${FOO:?"foo error"}

at the top of files. 

Admittedly the description on P.72 of Bourne's book is misleading -- it
would be hard for a novice to see the point of the : command just by
looking.

pete
--
*Peter Fenelon -- Research Associate -- Software Safety Assessment Procedures*
Dept. of Computer Science, University of York, York, Y01 5DD (+44/0)904 433388
pete@minster.york.ac.uk `Today keeps slipping by me, it leaves no aftertaste.'