My first post here...
I cannot get variables to work when using inline KSH commands on a "su" command. I have a KSH script, below, that produces my problem:
#!/usr/bin/ksh
su <user_id> <<-END
export FLD1=`echo $PWD`
pwd
echo $FLD1
echo TEST
echo $PWD
END
The script will prompt me for the user's password, and then will display the following:
Password:
/home/jkreife
TEST
/home/jkreife
Notice the "blank" line between my $HOME directory and "TEST". It should have displayed the contents of the FLD1 variable, but does not. My intention is to run a KSH script that loads an Oracle DB using an oracle admin signon, but cannot get variables to work. Can any Unix expert look at this and give me some much needed help?
Thanks!
Joe K.