Shell (BASH) programming

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.