官术网_书友最值得收藏!

When not to use scripts

Shell scripts have certain advantages over compiler-based programs, such as C or C++ language. However, shell scripting has certain limitations as well.

The following are the advantages:

  • Scripts are easy to write
  • Scripts are quick to start and easy for debugging
  • They save time in development
  • Tasks of administration are automated
  • No additional setup or tools are required for developing or testing
    shell scripts

The following are the limitations of shell scripts:

  • Every line in shell script creates a new process in the operating system. When we execute the compiled program, such as a C program, it runs as a single process for the complete program.
  • Since every command creates a new process, shell scripts are slow compared to compiled programs.
  • Shell scripts are not suitable if heavy math operations are involved.
  • There are problems with cross-platform portability.

We cannot use shell scripts in the following situations:

  • Where extensive file operations are required
  • Where we need data structures, such as linked lists or trees
  • Where we need to generate or manipulate graphics or GUIs
  • Where we need direct access to system hardware
  • Where we need a port or socket I/O
  • Where we need to use libraries or interface with legacy code
  • Where proprietary, closed source applications are used (shell scripts put the source code right out in the open for the entire world to see)
主站蜘蛛池模板: 健康| 哈尔滨市| 泰州市| 梁山县| 平乡县| 桂阳县| 城步| 和龙市| 伊金霍洛旗| 夏河县| 开封市| 蒲城县| 白城市| 建昌县| 阿巴嘎旗| 怀化市| 缙云县| 绥宁县| 石泉县| 鹤庆县| 金川县| 巴青县| 犍为县| 昌宁县| 广安市| 绵竹市| 宣汉县| 竹山县| 金门县| 慈溪市| 高邑县| 洪湖市| 奉化市| 通辽市| 曲水县| 平阴县| 宜兰市| 西充县| 突泉县| 剑川县| 定南县|