help-bash
[Top][All Lists]
Advanced

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

[Help-bash] Anomalies with ${*}


From: Bill Gradwohl
Subject: [Help-bash] Anomalies with ${*}
Date: Mon, 26 Mar 2012 22:13:56 -0600

Sorry for building on my last email, but I found some other anomalous behavior with ${*}.

abc='  '
echo "->${abc}<-"
echo "->${abc// /}<-"

set -- '' '' ''
echo "->${*}<-"
echo "->${*// /}<-"

IFS='' set -- '' '' ''
echo "->${*}<-"

IFS= set -- '' '' ''
echo "->${*}<-"

IFS=''
set -- '' '' ''
echo "->${*}<-"

IFS=
set -- '' '' ''
echo "->${*}<-"

Every one of the echo's referencing * should be a null string as far as I can tell, but some aren't.

Why does nulling out IFS work as a separate statement, but not on the same line?

It works when IFS='' precedes read on the same line, so why not before set?

The reason I'm doing this is to see if all the passed parameters are null strings.

I'm sure there's a man bash exception I missed somewhere, but where?

Thank You

--
Bill Gradwohl


reply via email to

[Prev in Thread] Current Thread [Next in Thread]