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

I can only understand/comment your .profile when you post it. Either here or maybe in your Ronnie's scratchpad.

pelagic

Replies are listed 'Best First'.
Re^8: Unix Aliases?
by Ronnie (Scribe) on Sep 08, 2004 at 19:21 UTC
    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
        Sorry to be a complete dummy - that doesn't usually stop me! - I understand & agree with your analysis of this script but..... When getenv is run against this file TWO_TASK is omitted and I can't see a reason why. (I removed the semi-colon and it still didn't appear). I am also confused about your Conclusion; I can certainly execute the .profile as a "system" call but I am unaware of a means to access an alias in Perl can this be done or were you referring to UNIX here? Cheers, Ronnie