0% found this document useful (0 votes)
19 views

Shell Scripting 2.1.2

The document discusses shell scripting and provides an example shell script. Shell scripts are programs designed to be run by the Unix/Linux shell and can perform tasks like file manipulation and program execution. The example script uses the read command to take keyboard input and assign it to a variable which is then printed.

Uploaded by

Pramod
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Shell Scripting 2.1.2

The document discusses shell scripting and provides an example shell script. Shell scripts are programs designed to be run by the Unix/Linux shell and can perform tasks like file manipulation and program execution. The example script uses the read command to take keyboard input and assign it to a variable which is then printed.

Uploaded by

Pramod
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

SHELL SCRIPTING TUTORIAL

http://www.tutorialspoint.com/unix/shell_scripting.htm Copyright © tutorialspoint.com

Advertisements

A shell script is a computer program designed to be run by the Unix/Linux shell which could be one of the following:

The Bourne Shell


The C Shell
The Korn Shell
The GNU Bourne-Again Shell

A shell is a command-line interpreter and typical operations performed by shell scripts include file manipulation,
program execution, and printing text.

Extended Shell Scripts


Shell scripts have several required constructs that tell the shell environment what to do and when to do it. Of course,
most scripts are more complex than the above one.

The shell is, after all, a real programming language, complete with variables, control structures, and so forth. No matter
how complicated a script gets, it is still just a list of commands executed sequentially.

The following script uses the read command which takes the input from the keyboard and assigns it as the value of the
variable PERSON and finally prints it on STDOUT.

#!/bin/sh

# Author : Zara Ali


# Copyright (c) Tutorialspoint.com
# Script follows here:

echo "What is your name?"


read PERSON
echo "Hello, $PERSON"

Here is a sample run of the script −

$./test.sh
What is your name?
Zara Ali
Hello, Zara Ali
$

Subsequent part of this tutorial will cover Unix/Linux Shell Scripting in detail.

You might also like