new to linux/Ubuntu/shell scripting . . .
Todd Slater
dontodd at gmail.com
Mon Dec 5 21:37:28 UTC 2005
On 12/5/05, Rachael C. <amaroq3 at gmail.com> wrote:
> 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!
I'm coming in late on this, but doesn't [A-Za-z] take care of case?
Todd
More information about the ubuntu-users
mailing list