This question is from the book Programming Pearls 2nd Ed., Column 2, p.20. It's a simple C program that uses a sign.c and squash.c files to sort and squash anagrams (display each group of anagrams on separate lines).
To test the program, I have to run the following line in the terminal:
sign <dictionary | sort | squash > gramlist
instead of using a file/dictionary, I wanted to enter a small list of words/anagrams and see if the program sorts and squashes the anagrams appropriately.
For example, entering the following words as the input
mile lime rot tor break
should give me the following output:
break
lime mile
rot tor
My question : what's the syntax to enter those words as the input? Neither of these works:
sign <"mile, lime, rot, tor, break" | sort | squash > output.txt
sign <"mile lime rot tor break" | sort | squash > output.txt
sign <'mile lime rot tor break' | sort | squash > output.txt
sign <'mile, lime, rot, tor, break' | sort | squash > output.txt
sign <mile, lime, rot, tor, break | sort | squash > output.txt
sign <mile lime rot tor break | sort | squash > output.txt
The complete code for sign.c and squash.c is here