bug-bash
[Top][All Lists]
Advanced

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

Re: why must non-standard $IFS members be treated so differently ?


From: Greg Wooledge
Subject: Re: why must non-standard $IFS members be treated so differently ?
Date: Mon, 30 Jul 2012 08:08:54 -0400
User-agent: Mutt/1.4.2.3i

On Sun, Jul 29, 2012 at 03:04:21PM -0400, Chris F.A. Johnson wrote:
> On Sun, 29 Jul 2012, Jason Vas Dias wrote:
> >    function count_args     {                v=($@);  echo ${#v[@]}; }
> 
>    Always quote $@. Without quotes, it's the same as $*
> 
> function count_args     {                v=( "$@" );  echo ${#v[@]}; }

count_args() { echo $#; }

However, if you actually wanted to stuff the function's positional
parameters into an array for some other reason, Chris is absolutely
correct.



reply via email to

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