Question: Using putty with Bash shell I am trying to complete this step: Use an if to determine whether the item at the path is a

Using putty with Bash shell

I am trying to complete this step:

Use an if to determine whether the item at the path is a file. If it is, do the following:

Use an if to determine whether the user running the script is the owner of the file or not and display that information. The username of the user running the script is available in the global variable $USER.

Use an if to determine whether the file is empty, and display a message saying either it is or is not empty.

Display the users permissions on the file in the form rwx. For instance, if the user has read and execute but not write, you would display r-x. Youll probably need to use 3 ifs to do this, one checking for each permission.

Finally, return an exit status of 0.

Below is my code, I started getting errors after the if [ -s $path ] statement, I need help where I am going wrong with syntax

Using putty with Bash shell I am trying to complete this step:

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!