Question
YEAR CARD_NUMBER PLAYER_NAME QUANTITY_AVAILABLE TEAM
1. Sort the file ~smcgowan/Cyber/Unix/Data/cards according to the 2nd column in reverse order.
A) What sort command did you use?
B) What was the last line of output from the sort command?
2. Sort the file ~smcgowan/Cyber/Unix/Data/cards according to the 2nd column and resolve ties using the 3rd column.
A) What sort command did you use?
B) What was line 31 of the output from the sort command?
C) How would you put just line 31 on standard out?
3. You want to make a list of all the lines from the file ~smcgowan/Cyber/Unix/Data/cards that do NOT represent Mickey Mantle cards.
A) What is the grep command you would use to accomplish this?
B) How many different cards (lines) are in this list?
4. You want to list all the cards that are yankees. So you want to print all the lines that end in 'Yankees' or 'yankees'.(Note here that "print" does not mean to send to a printer. "Print" is a term used with awk by us UNIX types to mean "write to stdout")
A) What grep will get this done?
B) How many different cards (lines) are in this list?
5. Math-heads often use the ^ to represent exponentiation. You need to find all the lines that have a^2 ("squared") in the file ~smcgowan/Cyber/Unix/Data/equations.
A) What grep command would you use?
B) If you save the output from this grep to a file, what is the size (in bytes) of the file?
Solution Preview
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.
1. A)Answer:
$sort -r +2 -3 ~smcgowan/Cyber/Unix/Data/cards...
By purchasing this solution you'll be able to access the following files:
Solution.docx.