A series of operational statistics demand scripts

Source: Internet
Author: User

Recently, should be operational needs, wrote a log analysis of the script, the period is quite touching, special hair This article, suspended the days before the passing.

In fact, the principle of the implementation of the script is similar, but the evaluation of good and bad a standard should not be just to achieve the function.

For example, if you can make a first-time person feel like an old driver, then you're a big shot.



Gossip less, directly open the whole. Here's what a good script in my mind should be:

1, automation,

There is a coherent logic of thought. Before writing, you can write a general procedure for implementing the function.

There can be some judgment mechanism, such as the existence of the directory or the target does not exist, how the program runs.

You can also have some scripts that perform status feedback, such as appending to a log, sending an email to an administrator, etc.

2, standardization,

The script header should have a script comment explaining the script author, time, role, author contact information, etc.

Scripts are written to make people see what's going on, important, ambiguous places should have comments

Variable declarations of the same type, with the same prefix as possible, neat, beautiful

4, the flow of,

To write a complex script simple, such as script reuse, variable definition, and so on, the discard needs to discard

Scripts should be clear, structured, easy to access, and easy to follow

The whole script reads like it's playing games, crossing levels, one ring, one off.


A script written out, on the basis of satisfying functions, to meet the above needs, is my heart of a good script


This article is from the "it--Brother" blog, please make sure to keep this source http://402753795.blog.51cto.com/10788998/1847046

A series of operational statistics demand scripts

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.