Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
editing file in-place with '<>'
- X-seq: zsh-users 18912
- From: Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: editing file in-place with '<>'
- Date: Mon, 23 Jun 2014 16:06:08 +0800
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hi,
I'm reading the guide and find it's not the case said in the guide page 132 about '<>' in-place editing.
% echo test > redirtest
% sed 's/e/Z/g' <> redirtest 1>&0
% cat redirtest
test
tZst
And looks like we can get the in-place editing by adding another '<> redirtest' in the end and turn off
multios:
% zsh -f
localhost% unsetopt multios
localhost% echo test > redirtest
localhost% sed 's/e/Z/g' <> redirtest 1>&0 <> redirtest
localhost% cat redirtest
tZst
localhost%
So, it is the second '<> redirtest' reset the file offset of redirtest before sed outputs the result?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author