Sponsored Content
Homework and Emergencies Homework & Coursework Questions Student needs grep command help Post 303007950 by MadeInGermany on Friday 24th of November 2017 02:42:39 AM
Old 11-24-2017
Yes the ^ is the "beginning of the line" anchor.
Then you do not need the other \< "left word boundary" anchor.
But the \> "right word boundary" is useful so it does not match Johnny.
Even better would be the field separator, then it would not even match John-Mary. The field separator is the character : (or in the case of "space" a character set that consists of a character class [[:space:]].
For your challenge "above 3.69 below 4.0" match a 3 then a dot then a character set 7-9. Assuming that there is not a further decimal digit e.g. 3.699
Often forgotten: in a regular expression a plain . is an "any character" wildcard, so in order to match a literal dot you need to escape it \. or put it in a character set [.]

Last edited by MadeInGermany; 11-24-2017 at 03:54 AM..
 

6 More Discussions You Might Find Interesting

1. Programming

novice student needs help

Help! I am very stuck!!! I have to produce a practical implementation of ONC RPC for an assignment and I do not know where to start. I hve done much searching on sun's site but everything is too complicated for someone with my limited knowledge. I only know the very basic unix commands and have... (1 Reply)
Discussion started by: karen79
1 Replies

2. Linux

Student needs help...

I know taking the easy way out isn't going to help me learn anything, but hopefully it will at least give me some guidence... I have a project and here's what I have to do... A company is currently running a Digital VAX and I have to replace it with a Linux server. There are 19 terminals... (4 Replies)
Discussion started by: MGold4357
4 Replies

3. Shell Programming and Scripting

Newbie Student Need Help!

Is there anyone here that can help me with my unix assignment? I've been working on it for 3 days now. It is regarding writing a script. I've got a few questions that I need some answers. Please someone who are willing to help add me to their msn messenger: **************** In one part of... (0 Replies)
Discussion started by: DaSFLiP
0 Replies

4. UNIX for Dummies Questions & Answers

student need help!

yes im a student at Sandersville Technical College in Sandersville, Georgia. Im doing a presentation on UNIX can someone help me discribe what UNIX is and how to use it and the different features it has? (6 Replies)
Discussion started by: willnadaze
6 Replies

5. UNIX for Dummies Questions & Answers

Hello Everyone - Student in Need of Help

Hi everyone. Let me just start off by saying I'm a college student and I love playing around with UNIX. I registered here because I have a UNIX shell scripting class and I am having some issues with my homework. I'm not looking for answers to the problems, just some help to get me on my way.... (1 Reply)
Discussion started by: Hexum311
1 Replies

6. UNIX for Beginners Questions & Answers

Student needs grep command assistance

I am a student in a UNIX/Linux classes having hard time with grep looking for assistance on some home work I need to figure out some kind of grep command to get a out put that only gives me information from a sample file and only list the people with the first name John the sample file is named... (1 Reply)
Discussion started by: jetoutant
1 Replies
AID(1)								   User Commands							    AID(1)

NAME
aid - Query ID database and report results. SYNOPSIS
aid [OPTION]... PATTERN... DESCRIPTION
Query ID database and report results. By default, output consists of multiple lines, each line containing the matched identifier followed by the list of file names in which it occurs. -f, --file=FILE file name of ID database -i, --ignore-case match PATTERN case insensitively -l, --literal match PATTERN as a literal string -r, --regexp match PATTERN as a regular expression -w, --word match PATTERN as a delimited word -s, --substring match PATTERN as a substring Note: If PATTERN contains extended regular expression metacharacters, it is interpreted as a regular expression substring. Other- wise, PATTERN is interpreted as a literal word. -k, --key=STYLE STYLE is one of `token', `pattern' or `none' -R, --result=STYLE STYLE is one of `filenames', `grep', `edit' or `none' -S, --separator=STYLE STYLE is one of `braces', `space' or `newline' and only applies to file names when `--result=filenames' The above STYLE options control how query results are presented. Defaults are --key=token --result=filenames --separator=space -F, --frequency=FREQ find tokens that occur FREQ times, where FREQ is a range expressed as `N..M'. If N is omitted, it defaults to 1, if M is omitted it defaults to MAX_USHRT -a, --ambiguous=LEN find tokens whose names are ambiguous for LEN chars -x, --hex only find numbers expressed as hexadecimal -d, --decimal only find numbers expressed as decimal -o, --octal only find numbers expressed as octal By default, searches match numbers of any radix. --help display this help and exit --version output version information and exit REPORTING BUGS
Report bugs to bug-idutils@gnu.org SEE ALSO
The full documentation for aid is maintained as a Texinfo manual. If the info and aid programs are properly installed at your site, the command info aid should give you access to the complete manual. aid - 4.5 August 2010 AID(1)
All times are GMT -4. The time now is 08:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy