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

Re: 2 more questions


first, a LOT of thanks to you all for all of your answers! :-))

My second problem was easily solved by print -l which fits my needs  
perfectly. It's the same as echo "$VARIABLE" in sh (the quotes make  
for a newline there) which doesn't work in zsh.

The first, however, proved more tricky, mainly because I failed to  
make clear that I'd really need the stdout of the foregoing process  
in a VARIABLE, because I need it TWO times in the command  

Actually, my task was the following:


I thought I had read of such a variable in zsh somewhere and just  
couldn't find it anymore, but judging by your comments I was simply  

What I tried then was a

      $(cat $FILE | awk '{printf("mv %s %s\n",$1,$2)}')

This works perfectly with only one line in $FILE, but I couldn't  
get it to work with more than one. Obviously the shell interprets  
the WHOLE output of &(...) as always ONE SINGLE command no matter  
what I do.

So I ended up with

      LINES=($(cat $FILE))
      for LINE in $LINES
      $(echo $LINE | awk '{printf("mv %s %s\n",$1,$2)}')

which is the best solution I was able to find.

Thanks again!



Uli Zappe               E-Mail: uli@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                (NeXTMail,Mime,ASCII) PGP on request
Lorscher Strasse 5      WWW:    -
D-60489 Frankfurt       Fon:    +49 (69) 9784 0007
Germany                 Fax:    +49 (69) 9784 0042

staff member of NEXTTOYOU - the German NEXTSTEP/OPENSTEP magazine

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