Grep command problem~
Question
Display all of the lines in the file that contain "Raspberry" followed later in the line by the letter "a". File name = inventory I have no idea how I could possibly do it so I'm wondering if someone with more experience might be able to enlighten me. I've tried: grep "Rasberry.*a" inventory grep "Rasberry a" inventory grep "Rasberry.* a" inventory grep "Rasberry a" inventory None of these work, the only file in 'inventory' that matches the description is 'Raspberry Jam,1216,194' so I'm hoping someone could help me ;x Thanks. |
This worked for my data file...
grep "Raspberry.*[a]" inventory Regards |
Try
Quote:
|
Grrr, someone beat me to it :-(
|
Perhaps if you correctly spelt "Raspberry" ?.
|
Quote:
|
And to mr Weaver and Edwards: using a character class for
an individual character is pointless. ;} |
I didn't test his previous examples, but earlier in the day I had done similar with a range *shrugs* I would tend to argue that it occasionally helps readability while not a functional addition.
|
All times are GMT -5. The time now is 11:43 PM. |