When to use the shell

Source: Internet
Author: User
Tags posix

Because the shell appears to be a common feature between UNIX systems and is standardized by POSIX. As a result, shell scripts can be applied to many systems once they are "written attentively". Therefore, the reason to use shell scripts is based on:

    • Simplicity: The shell is a high-level language through which you can express complex operations succinctly.
    • Portability: Using POSIX-defined features, scripts can be executed on different systems without modification.
    • Easy to develop: a powerful and 妤 script can be completed in a short period of time.


However, given the command restrictions and efficiency of shell scripts, the following situations do not typically use the shell:

    1. resource-intensive tasks, especially when you need to consider efficiency (e.g., sorting, hashing, etc.).
    2. Mathematical operations that need to handle large tasks, especially floating-point operations, precision operations, or complex arithmetic operations (which are typically handled using C + + or FORTRAN).
    3. There are cross-platform (operating system) porting requirements (typically using C or Java).
    4. Complex applications where structured programming must be used (requires variable type checking, function prototypes, etc.).
    5. For mission-critical applications that affect the overall system.
    6. Tasks that require a high level of security, such as requiring a robust system to prevent intrusion, cracking, malicious destruction, and so on.
    7. A project consists of various parts of a chain of dependencies.
    8. Large-scale file operations are required.
    9. Support for multidimensional arrays is required.
    10. Support for data structures, such as linked lists or numbers, is required.
    11. Graphical interface GUI needs to be generated or manipulated.
    12. Requires direct operating system hardware.
    13. I/O or socket interface required.
    14. Interfaces that require the use of libraries or legacy old code.
    15. Private, closed-source applications (shell scripts put the code in a text file, as the world can see it).


If your app fits any of the above, consider a more powerful language-perhaps Perl, Tcl, Python, ruby--, or a higher-level compilation language such as C + + or java. Even so, you'll find that using the shell to prototype your application is also very useful in the development steps.

When to use the shell

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.