Homework - Linux1 - Script-1
Homework - Linux1 - Script-1
Create a simple basic bash-script, DIRLIST.SH for creating a tekst-file (DIRLIST.txt), containing the
content of a directory on the file-system.
The scipts must be controllable by the first argument when started, the file must be written in /tmp.
Output in the tekst file (also the direcory listing) must be in uppercase:
Example:
./ DIRLIST.SH /var/log
MESSAGES
DMESG
AUTH.LOG
BOOT.LOG
..
..
In the comment of your script must be the name of the author(s), and student number, class,
version/revision of the script.
#!/bin/bash
#Ver 1.1
#Created by Yuri van der List / 1124556 / [email protected]
# Direcotory-listing script
# This script creates a directory listing and file count for any directory that is used when starting
this script.
# none bugs, It crashes when the directory-name is missing or incorrect, I had no time to fix this
# Variables used: counter: calculated number of files
………
Please use variables if you can, and add comment in the code. Describe the variables if possible in
comment like i did with one off them above.
Tip: make your script executable: chmod u+x DIRLIST.SH
Email your script as an attachment, as a zipped-tar-file (DIRLIST.tgz) which must be runeable(!), and
well tested, as a zipped tar-ball, to: [email protected]
Bonuspoints: Add input validation if you have time and energie left, so I cannot break the script.
If you work in groups (4 persons max), put all the names and studentnumbers in the comment