Advanced shell programming
Overview
Sending and trapping
signals
Signal names
Functions
Aliases
The 'exec' mechanism
The 'eval' mechanism
Sending data across networks
Sending
printable characters
Splitting
files
Makefiles
Safe
programming
Setting up a terminal
More on
files
Miscellaneous utilities
Summary
Exercises
|
Exercises
-
Write a function thisyear to cause the
message This year is to be displayed followed by the
current year.
View solution
-
Write a function changedir to prompt you
for a directory name and cd to that directory. Why
must you use a function, and not a script?
-
Write a function called addtopath to
request you to type the name of a directory, and if that directory
exists and you can read it, to add it to the end of your
PATH .
View solution
-
Write a script to prompt you for the name of a directory, and
the email address of a user, and to mail the contents of that
directory to that user.
-
Define an alias debugsh to have the effect of
sh with option -x .
View solution
-
Write a script which will, every minute, display the date and
time, but when run in the foreground will terminate if it receives
ctrl-C 3 times.
-
Write a script to request you to type in the name of a shell
environment variable, and display its value.
View solution
|