Exercises

11.4. Exercises

Here are some useful things you can do using functions:

  1. Add a function to your ~/.bashrc config file that automates the printing of man pages. The result should be that you type something like printman <command>, upon which the first appropriate man page rolls out of your printer. Check using a pseudo printer device for testing purposes.

    As an extra, build in a possibility for the user to supply the section number of the man page he or she wants to print.

  2. Create a subdirectory in your home directory in which you can store function definitions. Put a couple of functions in that directory. Useful functions might be, amongs others, that you have the same commands as on DOS or a commercial UNIX when working with Linux, or vice versa. These functions should then be imported in your shell environment when ~/.bashrc is read.


156 visits (1 today, 3 this week, 19 this month, 156 this year)
Uptime: 07:51:28 up 4 days, 16:46, 2 users, load average: 0.00, 0.01, 0.00
2600:1f28:365:80b0:b86a:6c6a:14fb:cc81 GET from server z.larrymurakami.com

Tuesday, September 15, 2026 @ 7:51:28 AM
z.ServerAdmin@lamurakami.com