Help with using different types of GREP


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions Help with using different types of GREP
# 8  
I think I'm working on Soralis, Minted/Wiked if either of these words mean anything to you, but the type of questions I'm working through right now with this basic method, or am I wrong in saying that?
# 9  
Bump? I'm still in need of help with my latest questions, and pretty soon if its not too much trouble.
# 10  
To check in on solaris:
Code:
 uname -sr

What have you managed so far?
e.g.
Code:
grep '.*:[10]:*:*:*$' carslist.txt

Explain to me what the above code is supposed to do.
# 11  
Quote:
Originally Posted by vbe
To check in on solaris:
Code:
 uname -sr

What have you managed so far?
e.g.
Code:
grep '.*:[10]:*:*:*$' carslist.txt

Explain to me what the above code is supposed to do.
I'm not sure I undrstand what you mean by 'what I've managed' sorry. Smilie

And yeah, in that code I am trying to find all the car models which include digits within their name. Each .* is a seperate column in the layout from the text file, and the second column is the model, which is what I have labeled [10] with.

Hopefully I explained this without much confusion.
# 12  
For question m, try this:
Code:
#! /bin/sh
while read x
do
    echo $x | cut -d: -f2 | grep -E "[^e]e{2}[^e]" # Assuming 2nd column is car model name
    # The above line will print only those car model names with two e's 
done < carnames.txt

Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #79
Difficulty: Easy
GNU/Linux is directly descended from BSD.
True or False?

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Recursive grep with only certain types of files

Can I please have some ideas on how to do a recursive grep with certain types of files? The file types I want to use are *.c and *.java. I know this normally works with all files. grep -riI 'scanner' /home/bob/ 2>/dev/null Just not sure how to get it to work *.c and *.java files. (5 Replies)
Discussion started by: cokedude
5 Replies

2. Shell Programming and Scripting

Cp -r except certain file types

the following excludes certain directories successfully cp -r probe/!(dir) /destination I want to exclude certain file types and tried unsuccessfully cp -r probe/!(*.avi) /destination (2 Replies)
Discussion started by: tmf
2 Replies

3. What is on Your Mind?

What Types of Food Do You Like The Most?

On another simple topic, multiple choice answers OK ( you can pick more than one or suggest others - we will add your suggestions to the poll ). What Types of Food Do You Like The Most? (27 Replies)
Discussion started by: Neo
27 Replies

4. Programming

enumeration types in C

If I want to declare an array of structures in C and have the number of items in that array to correspond to the items of an enumeration, is there a way to access the maximum value in the enumeration when declaring the array? For instance: typedef struct { various fields.... } ... (3 Replies)
Discussion started by: cleopard
3 Replies

5. UNIX for Dummies Questions & Answers

How do I grep in specific file types?

I have a directory with file types ending .log, .mml, .gll, .dll . How can I grep expressions only in say the .log files? (3 Replies)
Discussion started by: bbbngowc
3 Replies

6. UNIX for Dummies Questions & Answers

mime types

Hi, I am trying to launch an ogg movie from a pdf file which has been produced with pdflatex and \movie {\centerline{\includegraphics {grafiques_xerrades/un_manolo_amb_camera.pdf}}} {hlims_xerrades/XocCumuls.ogg} The switch "externalviewer" makes kpdf launch the default... (5 Replies)
Discussion started by: pau
5 Replies

7. UNIX for Dummies Questions & Answers

Two types of pipes?

What is the difference between: cd /tmp tar -cf - *.txt |gzip > tmp_txt.tar.gz and cd /tmp mknod pipe p gzip < pipe > /tmp/tmp_txt1.tar.gz & tar -cf pipe *.txt Apart from the fact that we have to create the pipe file manually, is there any difference in the performance of the two?... (5 Replies)
Discussion started by: blowtorch
5 Replies

8. UNIX for Dummies Questions & Answers

backup types

can anyone explain me difference between tar and ufsdump commands.............and also i wd like to know the difference between incremental and differential backup......... thx in advance (1 Reply)
Discussion started by: girish_shukla
1 Replies

Featured Tech Videos