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

Re: read stdin in variable howto ?



On 2006-01-31 13:07:44 +0100, Vincent Lefevre wrote:
> On 2006-01-31 10:28:13 +0100, Marc Chantreux wrote:
> > is there a way to use $(<) to read stdin ? it will be great for write
> > something like
> > 
> > for arg ( ${(f)"$(<)"} $@ ) treat_arg $arg
> 
> $(</dev/stdin) or $(</dev/fd/0)
> 
> but I don't know if this is portable.

$(<&0) also works.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA



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