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

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

Replies are listed 'Best First'.
Re^7: Unix Aliases?
by pelagic (Priest) on Sep 08, 2004 at 10:33 UTC
    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

        Ok then, let's see what your .profile does:

        1. Paragraph
        does setting for interactive session probably not needed for your batch task.

        2. Para
        does settings for SID ISWLIVE wich is default for interctive sessions.

        3. Para
        for interactive sessions. Maybe TWO_TASK should be exported too as this is ORA related.

        Next 3 Para
        these aliases can be used after execution of .profile to set environment (temporarily) to a different DB-SID.

        Conclusion
        call in a row .profile (and one of the aliases if you don't need the default SID). This should set up a environment you can use as a base for your batch actions.

        pelagic