For Programming A to Z this week we were asked to use the command line in order to compose a text:
Use a combination of the UNIX commands discussed in class (along with any other commands that you discover) to compose a text. Your “source code” for this assignment will simply consist of what you executed on the command line. Indicate what kind of source text the “program” expects, and give an example of what text it generates. Use
manto discover command line options that you might not have known about (grep -iis a good one).
I wanted to transform something very recognizable into something just shy of recognizable, so I chose to use The Tale of Peter Rabbit by Beatrix Potter as my source text. Here’s the code:
grep Peter <peter.txt | cut -d ‘ ‘ -f 3-5 | sort -r | >peteremix.txt
And here’s the result:
who was very underneath the bushes, to cry. to Peter! "One the second little stopped running or sorry to say sneezed "Kertyschoo!" not care. He most dreadfully frightened; jumped up and in it. Mr. himself up for down very quietly down to rest; but Peter wriggled beans to her as if it Peter and beyond Cotton-tail and Peter.