moth/packages/revwords/src/solution.sh

19 lines
262 B
Bash
Raw Normal View History

2011-11-01 18:56:04 -06:00
#! /bin/sh
## Run like this:
##
## socat EXEC:./solution.sh EXEC:./revwords 3<token.txt
##
lrev () {
while [ -n "$1" ]; do
echo $1 | rev
shift
done
}
while read line; do
echo $line 1>&2
enil=$(lrev $line)
echo $enil
done