Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

parameter expansion question



Hello,

I have a problem with parameter expansion, could you please take a look
at it?

I try to do the following:

print_em ()
{
	echo 1=$1 2=$2 3=$3
}

#this is ok, it prints 1=a 2= 3=b
print_em "a" "" "b"

#this is NOT ok, it prints 1=a 2=b 3=
foo='a::b'
print_em ${(s/:/)foo}

It seems like in the second case the empty string is not passed as the
2nd parameter. How to specify the expansion so it will pass the empty
string just like in the first example?

Thanks in advance,
Istvan








Messages sorted by: Reverse Date, Date, Thread, Author