zsh-users
 help / color / mirror / code / Atom feed
From: Duncan Sargeant <dunc@ucc.gu.uwa.edu.au>
To: zsh-users@math.gatech.edu
Subject: Re: 2 more questions
Date: Fri, 21 Feb 1997 22:48:26 +0800	[thread overview]
Message-ID: <19970221224826.13870@ucc.gu.uwa.edu.au> (raw)
In-Reply-To: <9702211128.AA08309@tallowcross.uni-frankfurt.de>; from Uli Zappe on Feb 02, 1997 at 12:28:36PM +0100

uli (Uli Zappe) scandalously alleged:                          (on Feb 21, 1997)
> 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

command2 `command1`

I can see how you were probably looking in the wrong place :)

> 
> 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.

echo ${(j:\n:)ARRAY} | command

umm, there may be a way to pipe the variable to stdin of command
without the use of echo ... I'd be interested to know what it is.

again you were probably looking in the wrong places for this answer
:)

I learnt these tricks and a whole lot more, or at least worked out
where to look for info in the man pages when I did a 
man -T ps zshall > zshdocs.ps (I think? from memory, anyway), to
create the man page as a postscript file, which I then printed, and
read like a book, making notes on all those cool features.  Its a
great way to more fully appreciate zsh, if you can afford the
paper.

,dunc

-- 
Duncan Sargeant, keraunothnetophobic.   WWW: http://www.ucc.gu.uwa.edu.au/~dunc/
Orr would be crazy to fly more missions and sane if he didnt, but if he was sane
he had to fly them.  If he flew then he was crazy and didn't have to; but if he
didn't want to he was sane and had to.  Yossarian was moved deeply and let out a
respectful whistle at the absolute simplicity of this clause of Catch-22. --jh


  parent reply	other threads:[~1997-02-21 15:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-21 11:28 Uli Zappe
1997-02-21 14:41 ` Tomas Gradin
1997-02-21 14:48 ` Duncan Sargeant [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19970221224826.13870@ucc.gu.uwa.edu.au \
    --to=dunc@ucc.gu.uwa.edu.au \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).