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

RE: Better ( rm foo; bar > foo ) < foo ?



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