Question: Learning Objectives To continue learning about shell interaction via the role of tokens, redirection, complex arguments, filename expansion, and complex command lines. To learn more
Learning Objectives
To continue learning about shell interaction via the role of tokens, redirection, complex arguments, filename expansion, and complex command lines.
To learn more about environment and user defined variables.
To learn more about special characters, startup files, command substitutions.
Lab Work
What is a token? How does the shell decide where one token ends and another begins?
Assume the file list contains the names of several of the files listed in your home directory. What is the result of running the following command?
wc `cat list` (Hint: Those are backticksnot apostrophes)
(Dont execute the command on your systemit probably wont work, just tell me what it would output.)
How does the shell interpret each of the following tokens? (Enter what is required on each line: U = utility, F = file, V= variable, A= argument)
_______ _______ < ________ || ________ > ________ ; _____ $____ | ________
How do you create a local variable named Tuesday with the value of 8-5 in the sh shell (our default shell)?
How do you create and export an environment variable called OCT with the value NOT PAID in the sh shell?
Assume you have an environment variable (e.g. exported) called LEVEL defined in your login Korn shell with the value one. Now, you start a child Korn shell. In the child shell, you enter the command LEVEL=two. You now start another child (grandchild) shell. What is the value of LEVEL now?
LEVEL = ___________________
How do you enable filename completion in the sh shell?
Locate the following utilities using whereis, and which on our system. Record the results in the following table:
| Utility | whereis cmd | which cmd |
| perl |
|
|
| ls |
|
|
| man |
|
|
| startx |
|
|
| cron |
|
|
What is the difference between the information provided by the whereis command and the information provided by the which command?
Complete the following table for wildcard usage based on the tutorial activites: (First one is an example of what I expect)
| Command | Description of Wildcard | Example Files |
| ls a* | All files that begin with a | apple, andrew, a.out |
| ls duke*.doc |
|
|
| ls *.jpg |
|
|
| ls ???.jpg |
|
|
| ls a?.jpg |
|
|
| ls m[aeiou]d |
|
|
| ls [d-g]o[gt] |
|
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
