117k views
0 votes
Describe the purpose of shell scripts. Provide one example to reflect the use of variables, constructs, or functions.

User Crossman
by
5.4k points

1 Answer

6 votes

Answer:

Kindly check explanation

Step-by-step explanation:

Shell scripts are used for writing codes which may involve writing together a complete set of task in a single script. These set if codes or instructions could be run at once without having to run this program one after the other on a command line. This way it avoid having to repeat a particular task each time such task is required. As it already combines a sequence of command which would or should have been typed one after the other into a compiled single script which could be run at once.

A shell script could be written for a control flow construct :

if [expression]

then (command 1)

else (command 2)

.....

User Anton Shishkin
by
5.9k points