Shell-independent *nix setup script

S

scott.hafeman

Hi,
Is it worthwhile maintaining a production application setup script in
Python as opposed to shell-script? The main goal of this setup script
is to sniff a user's environment and export environment variables to
the calling (parent) process.
Either way, some file would need to be sourced into the user's
environment, so why not use a richer language where the setup logic is
independent of the user's shell being used.

Thanks for your feedback,
Scott
 
B

brad

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.
 
S

scott.hafeman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top