1753845 Members
7648 Online
108806 Solutions
New Discussion юеВ

sed question

 
SOLVED
Go to solution
Rpger Tavener
Occasional Advisor

sed question

I'm trying to pass 2 variables into a control file for sqlldr. I can get it to work with either one of the sed statments below but I can't figure out the syntax to pass both variables at the same time.

sed "s/${REPLACEMENT_VAR}/${NEW_BATCH_ID}/" sed "s/${SYSDATE_VAR}/${DATE_VAR}/" ${OCAP_TRAILER_CONTROL_FILE} >${OCAP_NEW_CTL}

Thanks!
When the only tool you own is a hammer, every problem looks like a nail!
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: sed question

Hi Roger:

Does this help?

# X=a;Y=A;XX=b;YY=B;echo "a b c"|sed -e "s/${X}/${Y}/" -e "s/${XX}/${YY}/"

Regards!

...JRF....
Sachin Patel
Honored Contributor

Re: sed question

 
Is photography a hobby or another way to spend $