in reply to Re^4: Unix Aliases?
in thread Unix Aliases?

Well in fact our "my_env" is much more complicated and also accepts parameters to change it's behaviour. If your "my_env" does not take parameters just remove it completely. Actually I will remove it from my post above to make it more straight forward.

pelagic

Replies are listed 'Best First'.
Re^6: Unix Aliases?
by Ronnie (Scribe) on Sep 08, 2004 at 10:05 UTC
    Thanks for the information. There is one thing I should mention in case you are unaware of this; I've tested the sub and it works fine except for certain things. In our .profile we have a variable called TWO_TASK and it's set to isw_live, getenv ignores this line and doesn't set up the appropriate environmental variable. Things like PS1 & PS2 are also ignored. This may be intentional but as I can't find any documentation for env I thought I'd let you know. ( I also stuck in a couple of rogue variables fred=flintstone & barney=rubble and they were not picked up either.) Cheers,Ronnie
      I can only understand/comment your .profile when you post it. Either here or maybe in your Ronnie's scratchpad.

      pelagic
        I would appreciate any input that may help my addled noggin! The following is the file I am working with. (I know I could do this by creating 3 hash tables containing the relevant environments (accessed via a paeameter) but I'm now intrigued by the reason for this file not (completely) working by the method you offered. I suspect the alias parts and the PS1/2 variables are not picked up because they include some UNIX shell type execution. The TWO_TASKS being ignored is perhaps due to the semi=colon? Anyway it works upto and including SECTRAN. Cheers, Ronnie
        TERM=vt220; export TERM PATH=/usr/local/bin:/usr/bin:/usr/ucb:/etc:/isw/tpp/oracle/live/1.6.1/ +ids/bin:/isw/tpp/oracle/live/1.6.1/ids/forms60/mesg:/isw/appwork/live +/finance/guifmxs:. EDITOR=vi ;export EDITOR umask 002 ORACLE_TERM=vt220 ; export ORACLE_TERM ORACLE_SID=ISWLIVE ; export ORACLE_SID ORACLE_HOME=/isw/tpp/oracle/live/8.1.7; export ORACLE_HOME PATH=$PATH:${ORACLE_HOME}/bin:${ORACLE_HOME}/dbs export PATH LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/usr/lib:/usr/ucblib export LD_LIBRARY_PATH PS1='${ORACLE_SID} > ' PS2='?' SECTRAN_DIR=/home/interface/sectran export SECTRAN_DIR TWO_TASK=isw-live; # Addition to allow ORACLE Forms testing in TEST & Other environments +- Bob alias ISWTEST='ORACLE_SID=ISWTEST ; export ORACLE_SID; \ ORACLE_HOME=/isw/tpp/oracle/test/8.1.7; export ORACLE_HOME \ LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/ucblib export LD_LIBRARY_PATH PATH=/usr/local/bin:/usr/bin:/usr/ucb:/etc:/isw/tpp/oracle/test/1.6.1/ +idst/bin:/isw/tpp/oracle/test/1.6.1/idst/forms60/mesg:/isw/appwork/te +st/finance/guifmxs:. PATH=$PATH:${ORACLE_HOME}/bin:${ORACLE_HOME}/dbs export PATH' # ISWLIVE alias ISWLIVE='ORACLE_SID=ISWLIVE ; export ORACLE_SID; \ ORACLE_SID=ISWLIVE ; export ORACLE_SID ORACLE_HOME=/isw/tpp/oracle/live/8.1.7; export ORACLE_HOME LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/usr/lib:/usr/ucblib export LD_LIBRARY_PATH PATH=/usr/local/bin:/usr/bin:/usr/ucb:/etc:/isw/tpp/oracle/live/1.6.1/ +ids/bin:/isw/tpp/oracle/live/1.6.1/ids/forms60/mesg:/isw/appwork/live +/finance/guifmxs:. PATH=$PATH:${ORACLE_HOME}/bin:${ORACLE_HOME}/dbs export PATH' # ISWTEACH alias ISWTEACH='ORACLE_SID=ISWTEACH ; export ORACLE_SID; \ ORACLE_SID=ISWTEACH ; export ORACLE_SID ORACLE_HOME=/isw/tpp/oracle/general/8.1.7; export ORACLE_HOME LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/usr/lib:/usr/ucblib export LD_LIBRARY_PATH PATH=/usr/local/bin:/usr/bin:/usr/ucb:/etc:/isw/tpp/oracle/general/1.6 +.1/ids/bin:/isw/tpp/oracle/general/1.6.1/ids/forms60/mesg:/isw/appwor +k/general/finance/guifmxs:. PATH=$PATH:${ORACLE_HOME}/bin:${ORACLE_HOME}/dbs export PATH'
        Thanks for your help, Ronnie

        Edit by castaway, fixed closing code tag