Well if its alright then I may as well as them. I'm curently working through the same worksheet only I have moved onto advanced grep, and there are two questions in it that have me puzzled. Here they are.
Quote:
j) Find out which models of car do NOT contain a digit within their name. Where (line position) within the file are the cars which do have digits within their model name?
m) Find any car model names which include “ee”, without explicitly including “ee”
within your search pattern. Hint: Use curly { } brackets
n) Find out all car models beginning with “B”, and redirect these to a file called
“alpha-carslist.txt”. Append to this file, all car models beginning with “C”. How
many records are in the above file? (Hint: use the “wc -l” command)
And just to show you the layout of how the car list looks like, here are the first few lines, not all of them just in case it seems like too much.
Quote:
Ford:Mondeo:1997:Blue:5
Vauxhall:Vectra:1999:White:2
Seat:Ibiza:1996:Red:4
Peugeot:406:1999:Silver:1
McLaren:F1:1997:Black:2
Skoda:Octavia:2003:Silver:2
Peugeot:206:2000:Red:1
Even with the hints for m & n I'm still having trouble with what comands I should be using, all I know is that I have been using a format such as this for the most recent questions and answers.
Quote:
cat carslist.txt | grep '.*:.*:.*:.*:.*$'
or something similar anyway. Some more help on these would be greatfully appreciated. =-)