bash regular expressions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I wrote a bash script and all but the two commands below were marked wrong, so I need to correct them. Hope you don't mind pointing out my mistakes:
1. needs to output how many lines are there with a . (period) in them. I used the escape char \ before the period, but it apparently didn't work.

echo Output the number of lines that have a \"\.\" \(period\):
grep -c \. ./test.file

2. this one needs to output the number of lines containing the string '/*':

echo Output the number of lines that have the string \"'/'\*\":
grep -c /\* ./test.file


Thanks a lot in advance!
Ned


[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]
  Powered by Linux