Shell script Programming Related 1

Source: Internet
Author: User

Definition and use of 1.shell variables

my_dir= "/home/yk/desktop"   # ( any character in single quotation marks is output as is, the variable in the single-quote string is not valid;)

Echo $my _dir

echo ${#my_dir} #获取字符串长度

2.shell annotations

 Single line #

Multiple lines : <<eof EOF

3.shell Pass-through parameters

  $n. n represents a number, 1 is the first argument to execute the script, 2 is the second argument to execute the script, and so on ...

$ A file name to execute

./test.sh param1 param2 param3 #带参数执行脚本

$* and [email protected] is a list of all parameters, except that $* is to take all parameters as a parameter, [email protected ] Then there is one that counts as a

Shell script Programming Related 1

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.