Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Refer to the slides for week - 8 - Shell scripting and write shell scripts to complete the following tasks. Submit the screenshot for

Please Refer to the slides for week-8-Shell scripting and write shell scripts to complete the
following tasks. Submit the screenshot for the script and its output, both.
NOTE: Please replace the name of the script with the name you used for the script. In the
sample screenshot, I have used those names to create my script.
Step-1: Use vi or nano editor to write your script (Ex, nano YourScriptName.sh) for the
following tasks.
Step-2: After saving the script, save and exit out of the editor and make the script executable by
adding execute permission ( chmod +x YourScriptName.sh)
Step-3: Run your script using ./YourScriptName.sh
Task A (Correct script (25 points)+ result/output after executing the script (25
points)- Conditional Statement
Write a shell script using nano or vi editor (eg, nano scriptname.sh) like below, that performs
the following task:
1. Add the Shebang (#!/bin/bash) as the first line in your script.
2. Read a number using read function
3. Using if statement, check if the input number is less than 10, then print the message
Input number is greater than 10.
4. If the number is not greater than 10, then print the message, Input number is not
greater than 10.
(Your script should result into the output similar to this sample screenshot after executing as
shown below)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions