In Replit create a new file:
Provide a name for the file: Ex1.sh
It will appear in your Files list. When you click the name of the script, a script editor will automatically open in a separate tab next to the Shell. This is the place where we will write the code of the script.
0 of 9 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 9 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
First line should be the shebang. What’s the code for this?
The second line will be the following comment: Create a variable. What’s the code for this?
Create a variable
The next line creates a variable called folder with value Documents. What’s the code for this?
On the fourth line we add:
#Go to folder
On the fifth line we add code to go to the folder (using the variable we created). What’s the code for going to the folder?
The sixth line contains code to write “We are in” followed by the name of the folder? What is the code for this?
‘We are in’
The next 2 lines are:
#List content
echo ‘This folder contains the following files and folders:’
On the last line we write the command to show the list of files and folders. What’s the code for this?
What’s the command to make Ex1.sh executable?
prompt $ Ex1.sh
How to check that the file is executable?
prompt $
What’s the code for running the script?
prompt $ Ex1.sh
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |