![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| script running with "ksh" dumping core but not with "sh" | simhe02 | HP-UX | 9 | 4 Weeks Ago 05:52 PM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-19-2007 10:52 PM |
| How to get Find command work with a variable passing "*" value? | unxuser | Shell Programming and Scripting | 5 | 08-16-2006 07:47 AM |
| By angle-brackets/"pipe" button doesn't work? | riwa | Linux | 1 | 04-02-2006 03:43 PM |
| "whenever sqlerror exit 1" does not work on Linux | nir_s | Shell Programming and Scripting | 2 | 09-22-2005 07:41 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Joekreif,
Try putting single quotes before and after the END: su <user_id> <<-'END' |
|
#3
|
|||
|
|||
|
Resolved!!!
You are a bloody genius!!! That did the trick. Thank you very much!
Joe K. |
|
#4
|
||||
|
||||
|
You are welcome, Joekreif, but this time, it was a co-worker of mine
who gave the solution. The main thing is to get the problem resolved. |
||||
| Google The UNIX and Linux Forums |