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

editing file in-place with '<>'



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