SHELL programming
Directory:
1.shell Brief Introduction
2.shell Programming Preparation
3.shell Programming Structured Language Building
4. Other
Two examples of 5.shell programming
Write in front:
1.Hello World
#! /bin/bash# This is aexample of bash helloworld# you can start Shell programming with a Hello world example
Echo ' Hello World '
2. Calculate 1+1=2
#!/bin/bash## This example would bring you to bash shell Moredeeply.# function:add-input numbers and Thenprint the result.if[$#-ne2] # error handling Then Echo "Usage-$ x y"# Display Help messageEcho "Where x and Y are the nos for which I'll print sum"Exit1fi Echo "Sum of $ and $ is ' expr $ + $ '"
Body:
1.shell Brief Introduction
As we all know, computers recognize binary languages, and computer instructions are used in binary notation, but this is very difficult for us. So in some operating systems there is a special program called the Shell, the shell accepts the command you entered, and if it is correct, it passes the instruction to the kernel.
A shell is a user program, or an environment in which a computer interacts with a user. The shell is an interpreted language that can execute commands from a standard input device (keyboard) or a file. The Linux shell is similar to Windows command, but the former is more powerful.
2.shell Programming Preparation
3.shell Programming Structured Language Building
4. Other
Two examples of 5.shell programming
Shell (BASH) programming