Lab 3 Class Tasks
Lab 3 Class Tasks
OS LAB TASKS
Write a shell script that takes two numbers as command-line arguments, adds them, and prints
the result.
QUESTION2:
Write a script that accepts a sentence and counts the number of words in
it. QUESTION3:
Write a shell script that takes a filename as input, checks if it exists, and appends the current
date and time to it.
QUESTION4:
QUESTION5:
Directory Cleanup Script
Develop a bash script to automate directory cleanup tasks by removing old files and directories.
The script should:
a. Accept a directory path as an argument.
b. Identify and delete files older than a specified number of days.
c. Recursively remove empty directories within the specified directory.
d. Provide feedback to the user about the cleanup process, including the number of files
and directories removed.