unix script

can someone tell me why my unix script does not work?
when I run it and then do an

env|grep ORA

nothing comes back so I know it is not working

system is aix 6.1
I use Kornshell


#!/bin/ksh
#Terminal settings
REV=`tput rev`
BLINK=`tput blink`
BEL=`tput bel`
BOLD=`tput bold`
ULINE=`tput smul`
DIM=`tput dim`
OFF=`tput sgr0`
MACH=`uname -n`
#
 while true
 do

clear
echo "Select which oracle database you would like to user..."
echo
echo "1)  parprd"
echo "2)  karprd"
echo
echo "Enter Choice: \c"
read CHOICE
echo;echo
case $CHOICE in
1) echo "$REV$BOLD Setting env for parprd ... $OFF"
echo
sleep 1
export ORACLE_SID=parprd
export ORACLE_BASE=/oracle/product
export ORACLE_ADMIN=/oracle/product/admin
export ORACLE_HOME=/oracle/product/10.2.0
export PATH=$ORACLE_HOME/bin:$PATH
echo $ORACLE_SID
break;;
2)echo "$REV$BOLD Setting env for karprd ... $OFF"
echo
sleep 1
export ORACLE_SID=karprd
export ORACLE_BASE=/u01/oracle/product
export ORACLE_ADMIN=/u01/oracle/product/admin
export ORACLE_HOME=/u01/oracle/product/11.2.0
export PATH=$ORACLE_HOME/bin:$PATH
echo $ORACLE_SID
*) echo "Invalid choice..."
echo "Press <CR> to continue."
read ans
continue
esac
don
echo
#
LVL 1
bkreynolds48Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

woolmilkporcCommented:
You must "source" the script (i.e. run it as a part of your current shell).
A script run as a child process as usual will never change the environment of its parent!

"Source" a script by calling it with ". " (dot space) prepended:

.   /path/to/script

The third from last line of the posted code must read "done" instead of  "don", by the way.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bkreynolds48Author Commented:
yes I had copy/pasted the script and missed the e on done - but it is there

is there a way to source the script without doing the . /path/to/script?  I put it in my $HOME/bin dir
0
woolmilkporcCommented:
Do you mean:

.   $HOME/bin/scriptname

?  No problem!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.