new to linux/Ubuntu/shell scripting . . .

Rachael C. amaroq3 at gmail.com
Mon Dec 5 20:54:11 UTC 2005


Thanks, it looks like it was going for parts of words that where
palindrome-like so I got some palindromes, but I need whole words.  Am
trying to tweak it so I get whole words that are palindromes (also
using -i to ignore case), but not having luck yet.  What does -o mean?

On 12/5/05, Tobias Heinemann <theine at nordita.dk> wrote:
>  > thanks for the tip Scott!  It worked!  I then added in the sort:
>  > grep -w -e '\(.\)\(.\).\2\1' bigTextFile.txt| sort -d -r >
> palindromes.txt
>  >
>  > It sorted things in the order that I wanted, but its not getting the
>  > palindromes.  Its getting the whole text.  The example of the
>  > palindrome search I only found in one place.  Does anyone know of a
>  > better way?
>
> Try
>
>    grep -o "\([a-z]\)\([a-z]\)\2\1" bigTextFile.txt
>
> I don't know how to handle mixed upper and lower case palindromes like
> "Anna" though...
>
>
> Regards,
> Tobi
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>




More information about the ubuntu-users mailing list