Open main menu

CDOT Wiki β

Changes

SPR720 BASH Scripting Lab

162 bytes added, 11:28, 22 September 2008
Writing BASH Scripts: Added some hints
Write scripts to do three of the following tasks:
* # Loop through the files in your home directory, and for each readable file, ask whether the file should be printed, mailed to you, or ignored (P/M/I) and then take the appropriate action.* # Display the longest and shortest usernames on the system (usernames are in the first field in /etc/passwd).* # Count the number of users with user IDs between 500 and 10000 on the system (user IDs are the third field in /etc/passwd).* # Display the names of any filesystems which have less than 10% free space available (see the <code>df</code> command for this information).* # Ask the user for an e-mail address, then send the output of the <code>dmesg</code> command to that address.* # Count the number of files in the user's home directory which are not readable.* # For each directory in the $PATH, display the number of executable files in that directory. == Hints and suggestions == See the manpages for these commands: * wc (see the -w, -c, -l, and -L options)* lpr* mail* cut (see the -d and -f options)* df
= Deliverable =