/ Published in: Bash

URLs:
Use one of these nifty utilities to automatically process files in-place. Both store the results of programs which write to stdout until they are done, and then write the result. See also `sed`'s `-i` option. Be aware that this may clobber your files if an error occurs during processing, so it is best to back them up (though `reservoir` refuses to truncate files to nothing by default).
Use one of these nifty utilities to automatically process files in-place. Both store the results of programs which write to stdout until they are done, and then write the result. See also `sed`'s `-i` option. Be aware that this may clobber your files if an error occurs during processing, so it is best to back them up (though `reservoir` refuses to truncate files to nothing by default).
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# Example 1: capitalisation tr a-z A-Z < xy.txt | reservoir -o xy.txt tr a-z A-Z < xy.txt | sponge xy.txt # Example 2: evaluate #ifdefs of all C files in directory # unifdef is from http://dotat.at/prog/unifdef/ # MAKE A BACKUP BEFORE RUNNING THIS LOOP, YOUR FILES WILL BE OVERWRITTEN! find . -iname \*.c | while read file ; do unifdef $file | reservoir -o $file ; done
Comments
