new to linux/Ubuntu/shell scripting . . .
Rachael C.
amaroq3 at gmail.com
Mon Dec 5 21:24:47 UTC 2005
Ok, here is where I am at with this:
grep -i -w -e '\([a-z]\)\([a-z]\)\2\1' tester.txt| sort -d -r > palindromes.txt
I used the tester.txt to get a better idea of what is happening. This
code can find all the 4 character long palidromes if they are one word
per line, but not if they are all on one line with spaces between
then. It also misses the palindrome if it has a capital letter in it
when the rest are lowercase. Anyone have an idea of how to fix this??
Thanks in advance!
More information about the ubuntu-users
mailing list