Question: Write a bash script that will determine if a file type is a directory, a symbolic link, or something else. Requirements for your script: Name

 Write a bash script that will determine if a file type
is a directory, a symbolic link, or something else. Requirements for your

Write a bash script that will determine if a file type is a directory, a symbolic link, or something else. Requirements for your script: Name your script 04.sh Your script should use one parameter, $1, which will be a the name of a file, directory, hard link, symbolic link, etc., i.e. a name in the output of a Is command Your script should ensure there was a parameter provided when the script was ran. If not, a usage message should be output and the script terminated with an exit code of 1 Your script should use an if-elif-else command The if condition should test if the parameter is a directory, and output this message if true (parameter should be the value of the parameter provided when the script was ran): parameter is a directory The elif condition should test if the parameter is a symbolic link, and output this message if true: parameter is a link The else path should output this message: parameter is something else If you wish to test your script, you will need to create a file, symbolic link, and a directory Run these commands in the same directory as your script to create those: mkdir 04dir touch 04 file Focus Name your script 04.sh Your script should use one parameter, $1, which will be a the name of a file, directory, hard link, symbolic link, etc., i.e. a name in the output of a Is command Your script should ensure there was a parameter provided when the script was ran. If not, a usage message should be output and the script terminated with an exit code of 1 Your script should use an if-elif-else command The if condition should test if the parameter is a directory, and output this message if true (parameter should be the value of the parameter provided when the script was ran): parameter is a directory The elif condition should test if the parameter is a symbolic link, and output this message if true: parameter is a link The else path should output this message: parameter is something else If you wish to test your script, you will need to create a file, symbolic link, and a directory. Run these commands in the same directory as your script to create those: mkdix 04dir touch 04 file In -3 04file 04link

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!