05-02-2004
Question for school quiz
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. Programming
Hey check this out..it's only a 10 question quiz..but it's brain storming.
http://mulogic.phpnet.us/drupal
I scored 7/10 (3 Replies)
Discussion started by: luv2beuniq
3 Replies
2. Shell Programming and Scripting
How come every post in this forum is a request for help?
How about some fun?
What does the following command do?
nawk -F'+' '
{i=NF;for(;i;i--)if($i)w++}
END{
for(k in w){c=w;x=xk",";if(c>m)m=c}
for(;m;m--)if(m in x)print m,x
}
' <(man nawk) (2 Replies)
Discussion started by: colemar
2 Replies
3. AIX
Hi all,
A pop quiz is being organized in my project and I've been appointed as one of the quiz-masters. This is a sample of what we are bringing forth.
Feedback is welcome.
1)Name 2 commands used to display cluster state, but doesn't use the clinfoES daemon:
a) ... (0 Replies)
Discussion started by: themetalingus
0 Replies
4. UNIX for Beginners Questions & Answers
Hello, I'm new to Unix and need help answering these questions if possible, thanks.
---------------------------------------------------------------------------------------
In a shell script, which command could be place at the end of a command line to combine stderr and stdout into the stdout... (1 Reply)
Discussion started by: julianpeters
1 Replies
LEARN ABOUT OPENSOLARIS
look
look(1) User Commands look(1)
NAME
look - find words in the system dictionary or lines in a sorted list
SYNOPSIS
/usr/bin/look [-d] [-f] [-tc] string [filename]
DESCRIPTION
The look command consults a sorted filename and prints all lines that begin with string.
If no filename is specified, look uses /usr/share/lib/dict/words with collating sequence -df.
look limits the length of a word to search for to 256 characters.
OPTIONS
-d Dictionary order. Only letters, digits, TAB and SPACE characters are used in comparisons.
-f Fold case. Upper case letters are not distinguished from lower case in comparisons.
-tc Set termination character. All characters to the right of c in string are ignored.
FILES
/usr/share/lib/dict/words spelling list
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
SEE ALSO
grep(1), sort(1), attributes(5)
SunOS 5.11 29 Mar 1994 look(1)