You are not logged in.
Is there a simple way to do the following?
command < file > file.tmp; mv file.tmp file
Basically, I'm looking for a command-agnostic "< file > file" that doesn't just truncate file.
I'm using zsh, if that matters.
Last edited by muflax (2009-03-10 01:36:24)
Offline
Hi, i just uploaded a PKGBUILD[#1] for "rewrite" tool.
Usage: rewrite [-v] [-r "s/old/new/"] files.. "cat|cat"
-v verbose output (show compression ratios)
s/old/new/ sed expression for renaming files
files.. input file names to rewrite through pipeline
"cat|cat" pipeline expression to rewrite file through
This is a simple command for this purpose For example:
For example:
$ rewrite README "grep -v the"
[#1] http://aur.archlinux.org/packages.php?ID=24530
Last edited by djgera (2009-03-09 22:30:53)
Offline
Nice, thanks!
I'll mark this as solved, as there doesn't seem to be a way that relies only on the shell. But if someone has another idea, just post it.
Offline