Sponge of pipes
cmd1 $file | sponge $file
With sponge
at the end you can manipulate the file before and write to itself. But be careful if the commands before sponge
exit for some reason the file might be lost and you produce a empty file.
SH Dev Blog
about tec-stuff, math and a bit cooking
cmd1 $file | sponge $file
With sponge
at the end you can manipulate the file before and write to itself. But be careful if the commands before sponge
exit for some reason the file might be lost and you produce a empty file.