<p>I was looking at <a href="http://tldp.org/LDP/abs/html/why-shell.html" rel="nofollow noreferrer">http://tldp.org/LDP/abs/html/why-shell.html</a> and was struck by:</p>

<blockquote>
  <p>When not to use shell scripts</p>
  
  <p>...</p>
  
  <ul>
  <li>Mission-critical applications upon which you are betting the future of the company</li>
  </ul>
</blockquote>

<p>Why not?</p>

[{'answer_id': 17238, 'author': 'SCdF', 'author_id': 1666, 'author_profile': 'https://Stackoverflow.com/users/1666', 'pm_score': 0, 'selected': False, 'text': '<p>I would wager the author is showing they are uncomfortable with certain aspects of qualtiy wrt shell scripting. Who unit tests BASH scripts for example.</p>\n\n<p>Also scripts are rather heavily coupled with the underlying operating system, which could be something of a negative thing.</p>\n'}, {'answer_id': 17251, 'author': 'Tall Jeff', 'author_id': 1553, 'author_profile': 'https://Stackoverflow.com/users/1553', 'pm_score': 3, 'selected': False, 'text': "<p>I kind of think the article points out a really good list of the reasons when not to use shell scripts - with the single mission critical bullet you point out being more of a conclusion based on all the other bullets.</p>\n\n<p>With that said, I think the reason you do not want to build a mission critical application on a shell script is because even if none of the other bullet points apply <strong><em>today</em></strong>, any application that is going to be maintained over a period of time will <strong><em>evolve</em></strong> to the point of being bit by at least one of the those potential pitfalls at some point.....and there isn't anything you are really going to be able to do about it without it being a complete do over to come up with a fix....wishing you used something more industrial strength from the beginning.</p>\n"}, {'answer_id': 17260, 'author': 'Wing', 'author_id': 958, 'author_profile': 'https://Stackoverflow.com/users/958', 'pm_score': 3, 'selected': False, 'text': '<p>Scripts are nothing more or less than computer programs.  Some would argue that scripts are less sophisticated.  These same folks will usually admit that you can write sophisticated code in scripting languages, but that these scripts are really not scripts any more, but full-fledged programs, by definition.</p>\n\n<p>Whatever.</p>\n\n<p>The correct answer, in my opinion, is "it depends".  Which, by the way, is the same answer to the converse question of whether you should place your trust in compiled executables for mission critical applications.</p>\n\n<p>Good code is good, and bad code is bad - whether it is written as a Bash script, a Windows CMD file, in Python, Ruby, Perl, Basic, Forth, Ada, Pascal, Common Lisp, Cobol, or compiled C.</p>\n\n<p><em>Which is <strong>not</strong> to say that choice of language doesn\'t matter.</em>  There are very good reasons, sometimes, for choosing a particular language or for compiling vs. interpreting (performance, scalability, capability, security, etc).  But, all things being equal, I would trust a shell script written by a great programmer over an equivalent C++ program written by a doofus any day of the week.</p>\n'}, {'answer_id': 17263, 'author': 'Jon Ericson', 'author_id': 1438, 'author_profile': 'https://Stackoverflow.com/users/1438', 'pm_score': 3, 'selected': False, 'text': '<p>Obviously, this is a bit of a straw man for me to knock down.  I really am interested in why people believe shell scripts should be avoided in "mission-critical applications", but I can\'t think of a compelling reason.</p>\n\n<p>For instance, I\'ve seen (and written) some ksh scripts that interact with an Oracle database using SQL*Plus.  Sadly, the system couldn\'t scale properly because the queries didn\'t use bind variables.  Strike one against shell scripts, right?  Wrong.  The issue wasn\'t with the shell scripts but with SQL*Plus.  in fact, the performance problem went away when I replaced SQL*Plus with a Perl script that connected to the database and used bind variables.</p>\n\n<p>I can easily imagine putting shell scripts in spacecraft flight software would be a bad idea.  But Java or C++ may be an equally poor choices.  The best choice would be whatever language (assembly?) is usually used for that purpose.</p>\n\n<p>The fact is, if you use any flavor of Unix, you are using shell scripts in mission-critical situations assuming you think booting up is mission critical.  When a script needs to do something that shell isn\'t particularly good at, you put that portion into a sub-program.  You don\'t throw out the script wholesale.</p>\n'}, {'answer_id': 17357, 'author': 'dragonmantank', 'author_id': 204, 'author_profile': 'https://Stackoverflow.com/users/204', 'pm_score': 2, 'selected': False, 'text': "<p>It is probably shell scripts that help take a company <em>into</em> the future. I know just from a programming standpoint that I would waste a lot of time doing repetitive tasks that I have delegated to shell scripts. For example, I know most of the subversion commands for the command line but if I can lump all those commands into one script I can fire at will I save time and mental energy.</p>\n\n<p>Like a few other people have said language is a factor. For my short don't-want-to-remember steps and glue programs I completely trust my shell scripts and rely upon them. That doesn't mean I'm going to build a website that runs bash on the backend but I will surely use bash/ksh/python/whatever to help me generate the skeleton project and manage my packaging and deployment.</p>\n"}, {'answer_id': 17367, 'author': 'jj33', 'author_id': 430, 'author_profile': 'https://Stackoverflow.com/users/430', 'pm_score': 5, 'selected': True, 'text': "<p>Using shell scripts is fine when you're using their strengths.  My company has some class 5 soft switches and the call processing code and the provisioning interface is written in java.  Everything else is written in KSH - DB dumps for backups, pruning, log file rotation, and all the automated reporting.  I would argue that all those support functions, though not directly related to call-path, are mission critical.  Especially the DB interaction.  If something went wrong with the DB-interaction code and dumped the call routing tables it could put us out of business.</p>\n\n<p>But nothing ever does go wrong, because shell scripts are the perfect language for stuff like this.  They're small, they're well understood, manipulating files is their strength, and they're stable.  It's not like KSH09 is going to be a complete rewrite because someone thinks it should compile to byte code, so it's a stable interface.  Frankly, the provisioning interface written in Java goes wonky fairly often and the shell scripts have never messed up that I can remember.</p>\n"}, {'answer_id': 91860, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': -1, 'selected': False, 'text': "<p>Scripts are inappropriate for implementing certain mission-critical functions, since they must have both +r and +x permissions to function. Executables need only have +x.</p>\n\n<p>The fact that a script has +r means users might be able to make a copy of the script, edit/subvert it, and execute their edited Cuckoo's-Egg version.</p>\n"}, {'answer_id': 92305, 'author': 'David Webb', 'author_id': 3171, 'author_profile': 'https://Stackoverflow.com/users/3171', 'pm_score': 2, 'selected': False, 'text': '<p>When I read thise quote I focus on the "<em>applications</em>" part rather than the "mission critical" part.</p>\n\n<p>I read it as saying bash isn\'t for writing applications it\'s for, well, scripting.  So sure, your application might have some housekeeping scripts but don\'t go writing <code>critical-business-logic.sh</code> because another language is probably better for stuff like that.</p>\n'}, {'answer_id': 30283734, 'author': 'Nixbytes', 'author_id': 4708938, 'author_profile': 'https://Stackoverflow.com/users/4708938', 'pm_score': 0, 'selected': False, 'text': "<p>No matter we all need a flexible tool to interact with os. It is human readable interaction with an os that we use; it's like using a screwdriver with the screws. The command line will always be a tool we need either admin, programmer, or network. Look at the window they even expanded on their Powershell. </p>\n"}]
['https://Stackoverflow.com/questions/17231', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1438/']