Question: Using putty with Bash shell: I am trying to complete the following: Create a variable and set it equal to $1 ($1 is the value

Using putty with Bash shell:

I am trying to complete the following:

Create a variable and set it equal to $1 ($1 is the value of the first item from the command line, we will learn more about this later, but for now, we will use it to make testing easier.)

Display an introductory message including the path from the variable in step 1. The format is: Let me determine some facts about /somepath ...

Use an if to determine whether the item indicated in the path exists. Display a message indicating whether it does or does not exist. If it does exist, include in the message whether it is a file or directory. If the item does not exist, return an exit status of 1. Refer to the sample output for format and wording.

I have coded this so far, but get an error

Using putty with Bash shell: I am trying to complete the following:

What am I doing wrong?

path=' $1 ' echo "Let me determine some facts about /path..." if [ - d \$path ] then \#path exists and is a Directory echo "\$path exist.s" else \#path exists and is a Eile elso "\$path is a file" else Decho"\$path does not exist" exit 1 fi

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!