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

surprise with echo




   test()
   {

      echo  "echoing1: $@"
      echo  "echoing2: $*"
      echo  "echoing3: $* $@ killed"
      echo  "echoing4: $@ $* dead"
   }

   $  test

   echoing2:

... that catches me completely by surprise. " $@ "
anywhere in the string kills it dead.  I traced it back
to:

setopt rc_expand_param

Why should it do that? It's very cool what it permits
as explained in 'the book' p. 288, but is the above
part and parcel of that?

Of course there's nothing to print, but why kill the
entire string?  Something about a null array?
Can that be prevented?  It's all fine if there is an
argument, of course.  Is this a feature?  One could
deliberately design it  so that nothing gets printed
in case of no argument, still it seem counterintuitive.



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