Home Man
Today's Posts

Students must use and complete the template provided. If you do not use the template your post may be deleted! Special homework rules apply here.

Student needs grep command help

grep, homework, student

Login to Reply

Thread Tools Search this Thread
# 8  
Old 11-24-2017
Originally Posted by jetoutant
. . .
grep ECE 3\.[5-9] smallFile
grep 'ECE 3\.[5-9]' smallFile
grep ECE {3}\.[5-9] smallFile 
grep ECE '{3}\.[5-9]' smallFile

don't work to eliminate a 2or 4 before the dot
There's a fundamental difference between form 1, 3 and 4 and form 2 of your commands. Can you tell it?
Why shouldn't one form (which one?) work given you match the field separators in data file and regex?
# 9  
Old 11-24-2017
Put the grep expression in " " or ' ' quotes, otherwise even the shell tries substitutions.
Use bounds, at least "word boundary" anchors, better the field separator.
# 10  
Old 11-24-2017
Originally Posted by jetoutant
this worked

grep 3\.[5-9] smallFile | grep ECE

thanks for all the help it is much appreciated

now that I have been up about 20 trying to figure this out I can get some sleep now that I figure the 6 out next is shell script to be done when I wake up
Does that work if you use a BRE similar to that to look for a GPA greater than or equal to 3.00 and less than 3.50?

P.S.: How do you know the two digits and the decimal point you are matching are in the GPA field and not in the last field of your data?

Last edited by Don Cragun; 12-02-2017 at 11:53 PM.. Reason: Add postscript.
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Student needs grep command assistance jetoutant UNIX for Beginners Questions & Answers 1 11-23-2017 03:50 PM
Hello Everyone - Student in Need of Help Hexum311 UNIX for Dummies Questions & Answers 1 04-07-2007 11:37 PM
student need help! willnadaze UNIX for Dummies Questions & Answers 6 12-05-2005 09:23 AM
Newbie Student Need Help! DaSFLiP Shell Programming and Scripting 0 04-04-2005 07:19 PM
Student needs help... MGold4357 Linux 4 04-09-2004 10:44 AM
novice student needs help karen79 Programming 1 12-05-2003 09:15 PM

All times are GMT -4. The time now is 11:08 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
Show Password