I think that the big problem with shell is that it doesn&#x27;t really offer the right abstractions for a lot of this: one doesn&#x27;t (normally) want to run:<p><pre><code>    if [ ! -d &#x2F;opt&#x2F;foothing ]
      then rm -f &#x2F;opt&#x2F;foothing &amp;&amp; mkdir &#x2F;opt&#x2F;foothing
    fi
    cd &#x2F;opt&#x2F;foothing
    tar xf &#x2F;tmp&#x2F;instpkg.tar.gz
    sed -e s&#x2F;QQQbarvalQQQ&#x2F;$BAR_SETTING&#x2F; -i &#x2F;opt&#x2F;foothing&#x2F;config
    …
</code></pre>
Normally, one just wants to install &amp; configure foothing.  Abstracting that away in shell is possible but a pain: it doesn&#x27;t really have a rich language for composing paths and other variable values; quoting is a right royal pain; by the time one&#x27;s written a <i>fully-working</i> shell script (note that the snippet above has no error-handling, breaks if &#x2F;opt doesn&#x27;t exist, breaks if $BAR_SETTING contains whitespace and doesn&#x27;t enable one to override the foothing installation location), it&#x27;s nearly impossible to read &amp; understand.<p>The Right Answer would involve a language which enabled one to create one&#x27;s own syntactic abstractions in order to satisfy the general and specific needs of software installation.  As an example, it&#x27;d be nice to have a WITH-INSTALLATION-DIRECTORY construct, which ensures that a directory exists, ensures that it&#x27;s owned by the appropriate user, ensures that no other package already claims it (except that a previous version of the currently-being-installed package is okay), registers the directory <i>and everything created in it during WITH-INSTALLATION-DIRECTORY</i> as belonging to the currently-being-installed package, handles errors in a well-defined and useful manner for calling code, and so on and on and on.<p>And of course even <i>that</i> isn&#x27;t high-level enough: If I&#x27;m installing bazit, which depends on foothing and quuxstuff, then I&#x27;ll want to call something which ensures they exist.  Or maybe there&#x27;s an optional &#x27;dependency,&#x27; and I want to do certain things if they exist and certain if not.<p>And maybe it&#x27;s not low-level enough either.  What if I want to override one particular sort of installation behaviour, but not the rest?  What if I want to install a package in my own account, as myself?  Wouldn&#x27;t it be cool if I could set a few variables and the package manager Just Worked™?<p>As another user indicated, what all these tools really need is to be Lisp: versionable data which is code.  As Shiver&#x27;s work with scsh demonstrated, a Lisp-like language can be very pleasant to write POSIX applications in.  Macros enable one to create useful syntactic constructs which make meaning, rather than details, clear.  Dynamic variables (as in Common Lisp) easily enable customisation based on the call stack.  CL&#x27;s condition and restart systems are the gold standard for error signalling and recovery.