- Unix / Linux - The vi Editor
- Unix / Linux - Communication
- Unix / Linux - Processes
- Unix / Linux - Pipes & Filters
- Unix / Linux - Basic Utilities
- Unix / Linux - Environment
- Unix / Linux - File Permission
- Unix / Linux - Directories
- Unix / Linux - File Management
- Unix / Linux - Getting Started
- Unix / Linux - Home
Unix / Linux Shell Programming
- Unix / Linux - Manpage Help
- Unix / Linux - Shell Functions
- Unix / Linux - IO Redirections
- Unix / Linux - Quoting Mechanisms
- Unix / Linux - Shell Substitutions
- Unix / Linux - Loop Control
- Unix / Linux - Shell Loops
- Unix / Linux - Decision Making
- Unix / Linux - Basic Operators
- Unix / Linux - Using Arrays
- Unix / Linux - Special Variables
- Unix / Linux - Using Variables
- Unix / Linux - What is Shell?
- Unix / Linux - Shell Scripting
Advanced Unix / Linux
- Unix / Linux - Signals and Traps
- Unix / Linux - System Logging
- Unix / Linux - System Performance
- Unix / Linux - User Administration
- Unix / Linux - File System Basics
- Unix / Linux - Regular Expressions
Unix / Linux Useful Resources
- Unix / Linux - Discussion
- Unix / Linux - Useful Resources
- Unix / Linux - Commands List
- Unix / Linux - System Calls
- Unix / Linux - Builtin Functions
- Unix / Linux - Quick Guide
- Unix / Linux - Useful Commands
- Unix / Linux - Questions & Answers
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Shell Scripting Tutorial
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-pne 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 comppcated a script gets, it is still just a pst 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 Ap # 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 Ap Hello, Zara Ap $
Subsequent part of this tutorial will cover Unix/Linux Shell Scripting in detail.
Advertisements