Simple exercise for learning C:
- Reads text from STDIN
- By default, rotates all text by one character ("abc" => "bcd")
- Prints to STDOUT
- If the "-n [number]" flag is supplied, rotate by that many characters
- If the "-d" (decode) flag is supplied, rotate in the opposite direction
- If the "-f [filename]" flag is supplied, read from that file rather than STDIN
Actually, that second EC might be impossible, just based on the way STDIN works (e.g. run
cat
by itself -- it just hangs).