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

Re: virtual files?



"Nikolay Aleksandrovich Pavlov (ZyX)"
<kp-pav@xxxxxxxxx> writes:

> In some cases you may use `>(process)` to create
> file descriptor that will be used like a named pipe
> and may replace real files in some cases (it does
> not support seek(), also some processes have a habit
> of closing all file descriptors except
> stdin/stdout/stderr). But it is launched in subshell
> which limits the usefullness further (i.e.
> you cannot directly save result in a variable).

OK! That doesn't seem like any good samochuvstvie...

> Specifically this function does not need >() or any
> file at all:
>
>     ... echo -n \$ wget -q $link -O- | grep answer | cut
> -d \$ -f2 | cut -d \< -f1 ...

But you still need the escaped quotes around "answer"
otherwise it won't work due to the HTML data :)

Now, it is true you don't *need* files here or in
other situations like this. But it is a very good
thing to have, to be able to name something something,
and then stash the result there for future use.
A variable or data structure, in essence.

Obviously creating a normal file just to remove it
last thing doesn't score you any hacker points...

So I think this is a good idea for you to contemplate
incorporating in zsh!

-- 
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
                   - so far: 25 Blogomatic articles -                   



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