sh syntax question

Guy Harris guy at auspex.auspex.com
Wed Apr 26 05:40:50 AEST 1989


>> Also, someone pointed out that there is a very trivial bug with "$@" in
>> Bourne shell only, in that if there are no arguments, "$@" will actually
>> expand to one null arguement.  Use ${@:+"$@"} to fix this.

Well, some versions of the Bourne shell, anyway.  The S5R3 version has
this fixed, so any system whose Bourne shell is based on that version
won't have the problem.  However, for now, you may still want to program
defensively....



More information about the Comp.unix.questions mailing list