Shell position Variable

Source: Internet
Author: User

When we are learning some frameworks, we usually invoke a script when we start the framework, and pass some parameters to the script, and the script will do different things depending on the parameters we pass, and the parameters we pass are the positional variables.
How did the script identify the parameters we passed?
By .... Such a similar command to get,
For example:./test.sh a B
$: script itself test.sh
$: The first parameter of the script a
$: Second parameter B of the script
Write a script, test.sh in it.
Echo
echo $
Echo
Give test.sh, Empower, execute test.sh AB, view execution results

In this way, you can get the user's instructions in the script to perform different operations.

For more highlights, please follow: http://bbs.superwu.cn

Focus on the two-dimensional code of Superman Academy:

Shell position Variable

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.