Chapter 1th Overview of Shell programming

Source: Internet
Author: User

1.shell Introduction

The shell is a special-function program that provides an interface for users to interact with the kernel. It is used to receive commands entered by the user and send it to the kernel for execution.

The shell is an application that is called into memory when a user logs on to a Linux system. The shell is independent of the kernel, which is a bridge between the kernel and the application, and the input device reads the command and then turns it into a machine code that the computer can understand, before the Linux kernel can execute the command.

2. A simple shell script

whologged.sh

#!/bin/bashdate                                                                         who

Script Description:

line 1th is "#!/bin/bash", "#!" Symbols are called "Sha-bang" symbols (Sha-bang are combinations of sharp and bang. Sharp for #, Bang for! In a similar scenario, C # is often referred to as CSharp, whichis the starting symbol for the shell script, "#!" A symbol is a special token that specifies a file type, which tells the Linux system that the execution of this file requires an interpreter to be specified.

Program execution:

1. Add executable permissions for whologged.sh.

chmod a+x wologged.sh #a +x is for everyone to add executable permissions, including the owner, the owning group, and others

2. Input./wologged.sh

Operation Result:

Chapter 1th Overview of Shell 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.