Source-Changes-D archive

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

Re: CVS commit: src/distrib

In article <>,
Alan Barrett  <> wrote:
>On Fri, 18 Sep 2009, David Brownlee wrote:
>> Index: src/distrib/common/
>  [...]
>> +( while [ "X$1" != "X" ]; do
>> +    cat $1
>> +    shift
>> +done ) | awk -f ${NETBSDSRCDIR}/distrib/common/list2sh.awk | ${SHELLCMD}
>Why is the while loop necessary?  Why not just use
>       awk -f .../list2sh.awk "$@"
>As far as I can tell, the only difference between the while loop an my
>suggestion is in the behaviour when there are no args (which might
>never happen, or which can be handled by an additional test), or the
>behaviour when one of the args is an empty string (which I hope never

if [ -n "$1" ]; then
        awk -f .../list2sh.awk "$@"

and that "X$1" idiom needs to die as well as using unquoted variables
which will break for strings with whitespace.


Home | Main Index | Thread Index | Old Index