When not to use linux shell scripts

By:    Updated: February 27,2017

A working knowledge of shell scripting is essential to anyone wishing to become reasonably proficient at system administration, even if they do not anticipate ever having to actually write a script. Consider that as a Linux machine boots up, it executes the shell scripts in /etc/rc.d to restore the system configuration and set up services. A detailed understanding of these startup scripts is important for analyzing the behavior of a system, and possibly modifying it.

 

When not to use linux shell scripts

  • Resource-intensive tasks, especially where speed is a factor (sorting, hashing, recursion ...)
  • Procedures involving heavy-duty math operations, especially floating point arithmetic, arbitrary precision calculations, or complex numbers (use C, C++, Java instead)
  • Cross-platform portability required (use C, C++, Java instead)
  • Complex applications, where structured programming is a necessity (type-checking of variables, function prototypes ...)
  • Mission-critical applications upon which you are betting the future of the company
  • Situations where security is important, where you need to guarantee the integrity of your system and protect against intrusion, cracking, and vandalism
  • Project consists of subcomponents with interlocking dependencies
  • Extensive file operations required (Bash is limited to serial file access, and that only in a particularly clumsy and inefficient line-by-line fashion.)
  • Need native support for multi-dimensional arrays
  • Need data structures, such as linked lists or trees
  • Need to generate / manipulate graphics or GUIs
  • Need direct access to system hardware or external peripherals
  • Need port or socket I/O
  • Need to use libraries or interface with legacy code
  • Proprietary, closed-source applications (Shell scripts put the source code right out in the open for all the world to see.)

 

If any of the above applies, consider a more powerful scripting language -- perhaps Perl, Python, Ruby, PHP -- or possibly a compiled language such as C, C++, Java. Even then, prototyping the application as a shell script might still be a useful development step.

More in Development Center
New on Valinv
Related Articles
Sponsored Links