new to linux/Ubuntu/shell scripting . . .

Rachael C. amaroq3 at gmail.com
Mon Dec 5 18:53:12 UTC 2005


Thanks to all of you who gave me some tips on how to get to my shell
script and make it run.  You were a big help.  :D

The goal of this shell script it to read all the 4 character length
palindromes from a text file, then sort them in decreasing order and
output them into another text file.   I am also suppose to count the
number of palindromes that are found and print that number to the
screen.  Then wait for the user to hit the enter key and then print
out the text with all the palindromes and end the program.

After much searching of the web, this is what I have so far and have tested:

$ grep -w -e '\(.\)\(.\).\2\1' bigTextFile > palindromes.txt
and
$ cat palindromes.txt

both returned: "./palindromes.sh: line #: $: command not found"

I figured I would maybe add a "| sort -d -r" between "bigTextFile" and
 ">" and adding "$ wc -w palindromes [RET]" to print out the number of
palindromes, but I would like to get what I have now working first. 
Do I need to download anything to make grep and cat work?  Is my
thinking right on these commands?




More information about the ubuntu-users mailing list