By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,035 Members | 1,984 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,035 IT Pros & Developers. It's quick & easy.

Shell-independent *nix setup script

P: n/a
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
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
sc***********@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.
Jun 27 '08 #2

P: n/a
On May 22, 5:29*pm, brad <byte8b...@gmail.comwrote:
scott.hafe...@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
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.