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
ZGREP(1) General Commands Manual ZGREP(1)
NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)
ZGREP(1)