How does the environment stay set


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How does the environment stay set
# 1  
Old 03-18-2008
How does the environment stay set

I am running this pre-script with a post scripts that needs to share the same variables. How do I keep the environment variable settings for the next script to access from the RMAN Script?



Prescript #1


#RMAN Script
#!/bin/ksh
ORACLE_SID=INVPRD;export ORACLE_SID
DBNAME=$ORACLE_SID;export DBNAME
LOGDIR=/u01/app/oracle/product/10.2.0/scripts/logs/rman;export LOGDIR
CURRTIME=`date +"%y%m%d%H%M%S"`;export CURRTIME
LOGF=$LOGDIR/bkp_${DBNAME}_FULL_${CURRTIME}.log;export LOGF
START=`date +"%m/%d %H:%M"`
rman msglog $LOGF <<EOF


RMAN script# 2

connect target backup_admin/emcnw@INVPRD.WORLD
RUN {
ALLOCATE CHANNEL t1 TYPE 'SBT_TAPE';
backup database;
release CHANNEL t1;
}
exit;


Post script # 3

EOF
RC=$?
STATUS=OK
if [ $RC -ne 0 ]
then
STATUS=Error
fi
END=`date +"%H:%M"`
MSG="$STATUS $DBNAME RMAN_Full Backup $START-$END";export MSG
#mailx -s "$MSG " romptechteam@txu.com,vviswan1@txu.com < $LOGF
mailx -s "$MSG " vviswan1@txu.com < $LOGF
# 2  
Old 03-18-2008
Source prescript #1 inside the RMAN script, or write a 3rd script to do this
Code:
#!/bin/ksh
. script1
RMAN

I can't get what script #3 does. But the idea is to get the ENV variables defined in #1 to persist.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Trying to figure out how the environment variables are being set

I just started a new job and I've been tasked with cleaning up the files that set up all the environment variables. The system works as is. What happens is: 1. You log in to the server. 2. You call a file that sets a bunch of environment variables and that displays a list of all the databases... (4 Replies)
Discussion started by: Keyeh
4 Replies

2. Shell Programming and Scripting

Need to SET Environment variables

Hi Could you please tell me how to set environment variables in Unix ksh. And how can acess those varibles in shell scripts ( Please give the code with an example) For my scenario. We have written number of shell scripts with hard coded username and password. But if we want to... (1 Reply)
Discussion started by: shyamu544
1 Replies

3. Shell Programming and Scripting

Set environment

Hi, I can run shell script from the command line using $ . set If the run the script inside perl script using $var = system("set"); print $var; This prints 0. This command sets up the environment from command line. But when used inside the shell script or perl script it... (2 Replies)
Discussion started by: sandy1028
2 Replies

4. UNIX for Dummies Questions & Answers

ORACLE_HOME environment variable not set!

hi, i am new to perl: os : Linux i wrote simple perl script to select from table i am getting this error and how to set ORACLE_HOME environment variable : script: #!usr/bin/perl use DBI; use Mail::Sendmail; #use Date::Calc; use MIME::QuotedPrint; use HTML::Entities; use POSIX... (2 Replies)
Discussion started by: prakash.gr
2 Replies

5. Solaris

set environment variable?

I am working with solaris 9 sunBlade150 Box. I Installed a program, need to set the environment variable so that when the executable is entered,it finds the path to the executable. The documentation for the software says: Set the appropriate environment variable: Connect to server failed;... (8 Replies)
Discussion started by: smartgupta
8 Replies

6. Linux

How do i set environment variable

Hi, I am quite new to Linux. And I have doubt how to set new environment variable with value to a C executable. Let say I have a environment variable $Hack ; I would like to load a value for this variable; so that when the C executable is executed, the $Hack would set the variable value. ... (4 Replies)
Discussion started by: ahjiefreak
4 Replies

7. Shell Programming and Scripting

Help to set the oracle environment????

Hi, I am trying to set the environment for my oracle database. I have 5 database in an unix box. My idea is to create 5 files for each database with the following script on it. After logging into the unix box ...just by typing the database name....the enviornment for the database... (2 Replies)
Discussion started by: castlerock
2 Replies

8. UNIX for Advanced & Expert Users

set environment variable?

Installed a program, need to set the system up so that when the executable is entered, it finds the path to the executable. In Windows, set under system properties, advanced, environmental variables. How do I do this with Unix? Specifically using Solaris 9. I have tried: env... (3 Replies)
Discussion started by: kohoutek
3 Replies

9. UNIX for Dummies Questions & Answers

how to set up user environment in Solaris9?

The follwoing is my .cshrc: and when I log in and type init, I got the follwoing message: Usage: init and also my login prompt is not ORACLE.bantest>> I believed I am running /bin/sh **************************************************** #ident "@(#)local.cshrc 1.2 ... (5 Replies)
Discussion started by: simt
5 Replies

10. UNIX for Dummies Questions & Answers

how to set up linux environment variables?

Hi I'm using Linux, in the directory /root/my there is a.out. but when I try to run it , the shell indicate "bash:a.out: command not found" but I AM working in this directory. if I use "./a.out" , it works perfectly. can any body tell me how to do a permanent set up so that I can use... (5 Replies)
Discussion started by: dell9
5 Replies
Login or Register to Ask a Question