Shell-independent *nix setup script

scott.hafeman at rogers.com scott.hafeman at rogers.com
Fri May 23 13:14:05 EDT 2008


On May 22, 5:29 pm, brad <byte8b... at gmail.com> wrote:
> scott.hafe... at rogers.com wrote:
> > Hi,
> > Is it worthwhile maintaining a production application setup script in
> > Python as opposed to shell-script?  
>
> I do not think so. Perhaps 'in conjunction with', but not 'opposed
> to'... sh is the lowest common denominator of shells. Script for sh and
> your script will run on most any Unix. Python is gaining acceptance, but
> is still not present everywhere by default... Solaris for example.

If we consider the approach 'in conjunction with', is the following
adequately robust?
$ source app_setup.sh

#File: app_setup.sh
# -. shell-script .-
# Assume we can figure out some basic version of a python interpreter:
#  standalone executable
#  embedded within another application, providing basic libpython.a
features
#
$PYTHON sniffEnvWithComplexLogic.py 'shCompatibleEnvSettings.txt'
source shCompatibleEnvSettings.txt



More information about the Python-list mailing list