The first thing to know about scripting languages is that they are usually referred to as the parser for the command line interface. (from Wiki's explanation)
Part I: Understanding the shell
You can see that #!/bin/sh and!/bin/bash are used here. But what's the difference between two people? There is an explanation.
SH is a soft connection to bash. The full parameters of the Bash command for SH are:/bin/bash--posix (Thanks Yiffy here)
Part II: Conversion commands are used
As you can see here, I used the TR Replace command (the-M is a null character, \ n means a newline).
Character wrapping, what does it look like if you don't wrap the line?
Part III: Basic Shell Awareness
Here is a basic understanding. The shell script specifies that a standard variant is defined by defining a variable:"var=" Value". Then use the "${ variable name }" ! ("${# variable name }" Plus "#" for statistical length)
Part IV: Basic System variables
PATH represents the environment variable, the PWD represents the current directory, user represents the current user, and the UID represents the current user's uid,sheel indicates that the current shell,0 represents the current file name.
Note the yellow flag, and the environment variable must be capitalized. Capital. Capital.
Part V: Writing a small judgment root program
Finally: summary has been incorrectly corrected
There is a problem with the Environment variables section. The problem is that the shell is written in Sheel, so it's not effective.
The last. This article leads you to a basic shell framework that includes interpreter awareness, substitution commands, environment variables, and a small shell judgment root program.
ArchLinux Shell Basic Learning