Chapter Review


[Page 200 (continued)]

Checklist

In this chapter, I described:

  1. the common functionality of the popular Linux shells

  2. the common shell metacharacters

  3. output and input redirection

  4. filename substitution

  5. pipes

  6. command substitution

  7. command sequences

  8. grouped commands

  9. the construction of scripts

  10. the difference between local and environment variables

  11. the two different types of quoting

  12. basic job control

  13. the mechanism that the shell uses to find commands

  14. several core built-in commands


[Page 201]

Quiz

1.

Can you change your default login shell?

2.

What shell command is used to change your current directory?

3.

What is the difference between a built-in command and a utility?

4.

How can you make a script executable?

5.

Describe a common use for command substitution.

6.

Describe the meaning of the terms parent shell, child shell, and subshell.

7.

How do you think the kill command got its name?

8.

Describe a way to override a standard utility.

9.

What is a good umask value, and why?

Exercises

1.

Write a script that creates three background processes, waits for them all to complete, and then displays a simple message. [level: easy]

2.

Experiment with the exec command by writing a series of three shell scripts called "a.sh," "b.sh," and "c.sh" that each display their name, execute ps, and then exec the next script in the sequence. Observe what happens when you start the first script by executing exec a.sh. [level: medium]

3.

Why is the file that is created in the following session unaffected by the umask value? [level: medium]

$ ls -lG date.txt -rw-rw-rw-  1 glass     29 Aug 20 21:04 date.txt $ umask 0077 $ date > date.txt $ ls -lG date.txt -rw-rw-rw-  1 glass     29 Aug 20 21:04 date.txt $ _ 


Project

1.

Compare and contrast the Linux shell features against the graphical shells available on Windows. Which do you think is better? [level: medium]




Linux for Programmers and Users
Linux for Programmers and Users
ISBN: 0131857487
EAN: 2147483647
Year: 2007
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net