Shell-independent *nix setup script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • scott.hafeman@rogers.com

    Shell-independent *nix setup script

    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
  • brad

    #2
    Re: Shell-independent *nix setup script

    scott.hafeman@r ogers.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.

    Comment

    • scott.hafeman@rogers.com

      #3
      Re: Shell-independent *nix setup script

      On May 22, 5:29 pm, brad <byte8b...@gmai l.comwrote:
      scott.hafe...@r ogers.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 sniffEnvWithCom plexLogic.py 'shCompatibleEn vSettings.txt'
      source shCompatibleEnv Settings.txt

      Comment

      Working...