Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: Better ( rm foo; bar > foo ) < foo ?
- X-seq: zsh-users 3555
- From: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: "Danny Dulai" <nirva@xxxxxxxxxxx>, "Hannu Koivisto" <azure@xxxxxx>, "Zsh Users' List" <zsh-users@xxxxxxxxxxxxxx>
- Subject: RE: Better ( rm foo; bar > foo ) < foo ?
- Date: Thu, 7 Dec 2000 17:17:23 +0300
- Importance: Normal
- In-reply-to: <Liam.976189487.683696.18545.929187990@mergioo>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
>
> % cat foo
> one
> % mv =(sed 's/one/two/' foo) foo
> % cat foo
> two
>
> hows that?
Process substitutions are executed asynchronously. So, you are just lucky to
have small file. This particular example would work even in case of big file,
because sed still has original file opened even after it has been renamed. But
in general case you may have unexpected side effects ... something like
mv =(grep one foo; grep two foo) foo
second grep most probably will catch wrong file.
-andrej
Messages sorted by:
Reverse Date,
Date,
Thread,
Author