Shell Scripting Development Specification

Source: Internet
Author: User

1) Start specifying the script interpreter

#!/bin/sh; #!/bin/bash

2) opening plus version and copyright information


3) No Chinese comments in script

4) file saved with. sh extension

5) Full-time write-in of paired content to prevent leakage

6) [] have spaces at both ends of the brackets

7) Process Control statements are completed once, then add statements



Hint: You check the script clearly no problem, but is to perform a baffling error, to think of executing the Dos2unix command

Good habit: Each execution of the script is Dos2unix


Shell Debug Script method:

1) Shell debug echo Key command

2) shell Debugging bash parameters

Sh-n filename

Sh-x filename

sh-v filename

Shell Scripting Development Specification

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.