Common Linux Commands Explanation (fifth day)--shell variable learning

Source: Internet
Author: User

Due to the limited time, I wrote this blog for a maximum of 30 minutes. Only as a study note, the content will be as clear as possible. If you don't know what to say, you can hit me!

Joke opened, formally began today's study.

Some of the commands in the Linux system are under/bin, which is something that the average user can use. There are also some super users to use, this command is placed under the/sbin.

However, a part of the command is built directly into bash and is read directly into memory as the system starts. This can minimize the index time of the file and improve the efficiency of the system.

Can be viewed by using the type command. Type is the meaning of the. You can look at the image as Demon Mirror, and see what your essence is.

Let's take a look at the type command

Command execution, if a command is super long. than the middle. You can use the \ (backslash) to break the line. Let's take a look at how to use.

Variable functionality in the shell

What is the variable part of the shell variable part, bird brother is very detailed, but also very verbose. Maybe Brother bird face some of the crowd is not programming basis, so it is so meticulous, let this understanding.

The variables in the shell are no different from the variables in PHP. Need fame, like Roverliang = ' Roverliang is a good person ', then the right half of the equal sign is assigned to the left as an assignment statement. The calling variable is also strikingly consistent with PHP, using the $ character to print the variable with echo.  Echo $roverliang; The results will show that Roverliang is a very good person. Come on, everybody, verb play, let's look at the picture and talk.

Other places are more like PHP, such as the name of a variable cannot begin with a number. Single quotation marks do not resolve variables, single quotes parse variables. with Command Executor · (The key to the left of the number 1 key), execute the command. Use unset to delete the already famous variable.

Variable scopes are also available for variables. For example, we open the shell and the system assigns a process back. The variables that we set in this process are not allowed to go into the next process (need to be set, again later). Three processes show three variable scopes.

It took 50 minutes to write a blog for half an hour. It's good to learn Linux only one hours a day, but in fact it's 2 hours. In the future to strictly control the time, my MySQL will not have time to study.

If there is a summary of the wrong place, please also ask your friends to correct me.

Common Linux Command Interpretation (fifth day)--shell variable learning

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.