sed
- Crush the blank lines from a file and rename the output:
$ cat crush.sed
#!/bin/sh
# Takes one file as argument \
# and removes all blank\
# lines from it.
sed '/^[SPACETAB]*$/d' $1 > $1.new
- Trim trailing spaces and tabs and rename the output:
$ cat trim.sed
#!/bin/sh
sed 's/[SPACETAB]*$//' $1 > $1.new
- List all files newer than input file:
$ cat newer
#!/bin/sh
/bin/ls -t | sed '/^'$1'$/q'
|