Sponsored Content
Top Forums Shell Programming and Scripting please help (closed homework thread) Post 50790 by djeung on Sunday 2nd of May 2004 07:44:01 PM
Old 05-02-2004
please help

I have these questions for my unix class that I can't figure out because I missed a couple of days. They are for a quiz we took last week so by answering the questions you are not bettering my grade or doing my homework. I just want to understand was the answers. My teacher is really bad at explaining things.


1. Matcha line containing the assignment of a value to a legal shell variable in grep.

2. Match a word containing a repeating sequence of characters, with one or more characters in between, in grep, e.g., match "abcxyabc" or "xax", but not "abcd" or "aa".

3. Exchange the second and third words on a line with at least 4 words in sed, leaving the rest unchanged, e.g., "hi there joe kool" becomes "hi joe there kool", but "hi there joe" is unchanged.

4. Match lines containing one or more letters immediately followed by one or more digits in grep, e.g., match "abc123" or "a7" but not "az-12".

5. Match lines containing a repeating sequence of letters followed at any distance by one or more digits in grep, e.g., match "axax123" or "aaxyz7" but not "az12" in grep.
 

4 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

my thread got closed

I had a thread open and now it says it's closed. I had a question still on the forum and about 15mins after I posted my most recent question on it the thread said "closed". Why did this happen? I didn't violate any forum rules. Is there a limit on how many postings you can have in a single thread?... (1 Reply)
Discussion started by: hpicracing
1 Replies

2. Post Here to Contact Site Administrators and Moderators

Thread closed when learner has tried

I'm not so sure that this thread should have been closed. Though it was clearly homework the student was asking a specific question related to the assignment, but not the answer to the whole assignment. /www.unix.com/unix-dummies-questions-answers/107494-how-get-rid.html . IMHO The solution is... (1 Reply)
Discussion started by: methyl
1 Replies

3. UNIX for Dummies Questions & Answers

3 homework questions (thread closed)

1st) how can i print only directories? 2nd) how can i print files that someone used in the last X days (for example, 5). thanks very much, i need it for homework and teacher teachs us nothing:( (1 Reply)
Discussion started by: SupErioR
1 Replies

4. Solaris

Interview questions [thread closed]

Hi all, i have found a set questions from the net, i thought it will be great to ask and share with you gurus. I have the questions and some answers (correct me, if i am wrong) for these set of questions. 1. What file do you modify to change the mail aliases (Provide the full path) ? Ans:... (1 Reply)
Discussion started by: kingston
1 Replies
GREP(1) 						      General Commands Manual							   GREP(1)

NAME
grep - search a file for lines containing a given pattern SYNOPSIS
grep [-elnsv] pattern [file] ... OPTIONS
-e -e pattern is the same as pattern -c Print a count of lines matched -i Ignore case -l Print file names, no lines -n Print line numbers -s Status only, no printed output -v Select lines that do not match EXAMPLES
grep mouse file # Find lines in file containing mouse grep [0-9] file # Print lines containing a digit DESCRIPTION
Grep searches one or more files (by default, stdin) and selects out all the lines that match the pattern. All the regular expressions accepted by ed and mined are allowed. In addition, + can be used instead of * to mean 1 or more occurrences, ? can be used to mean 0 or 1 occurrences, and | can be used between two regular expressions to mean either one of them. Parentheses can be used for grouping. If a match is found, exit status 0 is returned. If no match is found, exit status 1 is returned. If an error is detected, exit status 2 is returned. SEE ALSO
cgrep(1), fgrep(1), sed(1), awk(9). GREP(1)
All times are GMT -4. The time now is 09:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy