Shell Road "first" shell introduction and Getting Started

Source: Internet
Author: User

Shell Introduction

1.Shell was born in Unix,unix's first scripting language, which is a tool for interacting with unix/linux, it is meaningless to learn the shell alone, and the proficiency of the shell is a reflection of the user's proficiency in unix/linux use.
2.Shell relies on other programs to do most of the work, which may be a flaw, but its undoubted strength is the simplicity of scripting language tagging and the faster and more efficient execution of programs written in C.

3.Shell scripts and programming languages are similar, there are variables and process control statements, but the shell script is interpreted to execute, do not need to compile, the shell program from a line of script read and execute these commands, the equivalent of a user to the script in a row of a line knocking at the shell prompt execution.

4.shell software at which level of the computer?
Hardware-System-shell-user

5. It is said that the shell (software) more than one?
There are four common types: bash, sh, csh, Ksh
We're learning Bash (full name: Bourne Again Shell)
Because most Linux/unix default is bash


How do I see what kind of shell the user is using? view/etc/passwd file OK?

My system's root user's shell is bash

The user can specify the shell type to use, Nologin on behalf of the user cannot use the shell

Shell Primer

1. Create the first shell program: VI 1.sh (file name arbitrary, suffix can not be. sh) #1, SH in/tmp directory

#!/bin/bashecho "Hello Shell"  #注释: ' Multiline comment '

The first method of execution:

Second mode of execution: (first line must have #!/bin/bash)

2.#!/bin/bash what role? Interpreter

There are two ways to execute a shell script, sh and bash (SH is a soft connection to bash, soft Connect is similar to a shortcut under Windows),./And the complete. sh file path is another, the difference between the two execution modes is that the former can be omitted.

#!/bin/bash, the latter cannot be omitted because the latter invokes the Bash interpreter through #!/bin/bash. The former Sh. SH's sh has been shown to specify the interpreter; But the common denominator is that both are in the directory operation where the. SH is located (except for the full. sh file path).

So over!!

3. Notes:

Single-line Comment #

Multiline comments (there are several ways): '




Shell Road "first" shell introduction and Getting Started

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.