ssam - stream interface to sam
ssam [ -n ] [ -e script ] [ -f sfile ]
[ file ... ]
Ssam copies the named files (standard input default) to the
standard output, edited by a script of sam commands (q.v.). When the
script starts, the entire input is selected. The -f option causes the
script to be taken from file sfile. If there is a -e option and
no -f, the flag -e may be omitted. The -n option
suppresses the default output.
- ssam -n ,10p file
- Print first 10 lines of file.
- ssam 'y/[a-zA-Z]+/ c/\n/' *.ms
- Print one word per line.
- ssam 's/\n\n+/\n/g'
- Delete empty lines from standard input.
- ssam 's/UNIX/& system/g'
- Replace every instance of by
- ssam 'y/[a-zA-Z]+/ c/\n/' | grep . | sort | uniq -c
- Count frequency of words read from standard input.
sed(1),
Rob Pike, ``The text editor sam''.
Ssam consumes all of standard input before running the script.