zsh-users
 help / color / mirror / code / Atom feed
* 2 more questions
@ 1997-02-21 11:28 Uli Zappe
  1997-02-21 14:41 ` Tomas Gradin
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Uli Zappe @ 1997-02-21 11:28 UTC (permalink / raw)
  To: zsh-users

Hi,

sorry I have to bother you yet again, but I have two more problems  
left that I couldn't solve with the zsh documentation:

1. Is there a way in zsh to pass the standard output to a parameter 
   instead of the standard input of a command? I.e. I have

      command1 | command2 parameter

   and need the output of command1 as the parameter for command2

2. How do I pipe the elements of an array into a command? If I do a

      echo $ARRAY | command

   the elements are separated only by whitespace instead of newlines 
   which will not work correctly especially if the elements possibly
   contain whitespace themselves. It works, of course, with a for-do
   loop but that's not efficient enough.

Thank you very much for every hint!


                Bye
                        Uli

______________________________________________________________________

Uli Zappe               E-Mail: uli@tallowcross.uni-frankfurt.de
                                (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
______________________________________________________________________



^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: 2 more questions
@ 1997-02-21 15:07 Wolfgang Hukriede
  0 siblings, 0 replies; 15+ messages in thread
From: Wolfgang Hukriede @ 1997-02-21 15:07 UTC (permalink / raw)
  To: zsh-users

Uli Zappe <uli@tallowcross.uni-frankfurt.de> wrote:

> 2. How do I pipe the elements of an array into a command? If I do a
>
>       echo $ARRAY | command
>
>    the elements are separated only by whitespace instead of newlines

or simply use a for loop, works with /bin/sh also:

 for i in $ARRAY; do echo $i; done | command.

Greetings, Wolfgang.


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~1997-02-23 21:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-02-21 11:28 2 more questions Uli Zappe
1997-02-21 14:41 ` Tomas Gradin
1997-02-21 14:48 ` Duncan Sargeant
1997-02-21 15:12 ` Zefram
1997-02-22  4:23   ` Uli Zappe
1997-02-22  5:04     ` Tomas Gradin
1997-02-22 10:02       ` Uli Zappe
1997-02-22 16:39       ` gwing
1997-02-22 17:48         ` Vincent Lefevre
1997-02-22 18:29         ` 2 more questions (and a bug report) Bart Schaefer
1997-02-22 19:49         ` 2 more questions Uli Zappe
1997-02-23 15:10           ` gwing
1997-02-23 15:28         ` Hrvoje Niksic
1997-02-23 21:24           ` Zefram
1997-02-21 15:07 Wolfgang Hukriede

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).