Question: Unix Assignment 1. Write a bash shell script that emulates the basic functionality of the ls command for the present working directory. Specifically for each
Unix Assignment
1. Write a bash shell script that emulates the basic functionality of the ls command for the present working directory. Specifically for each object in the directory your script must:
determine & display whether it is a directory, file, or other
determine & display the file owner's permissions for directories and files
utilize one or more Linux functions to minimize redundancy.
add error handling for SIGINT
hint - Use test commands for testing files within the loop (man test)
Example of the script output:
[jalcorn@blanca]$ ./quiz1 /home/jalcorn/hwfile is a file with owner permissions: rw- /home/jalcorn/hwscript is a file with owner permissions: rwx /home/jalcorn/testdir is a directory with owner permissions: r
2. Write a bash shell script using one or more functions to receive two words as input. Then count the number of characters per word and displays the word with the largest number of characters. If the words have the same amount of characters, then display all words of the same length.
Example of the script output:
[jalcorn@blanca]$ ./question5 one three
The longest word(s) is: three
[jalcorn@blanca]$ ./question5 one two
The longest word(s) is: one two
Save your script to /home/username/lab4/lab4.lab
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
