Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables not being recognized 1

Status
Not open for further replies.

ksbrace

Programmer
May 13, 2000
501
US
Hello,
I have a little script and the bolded line seems to be giving me fits in the first example.
Code:
#!/usr/bin/ksh93n
src=prod
dest=pprd

rm /oradata/dut/${dest}/*
rm /oractl/dut/${dest}/*
rm /oraredo/dut/${dest}/*

for i in `find  /orabak/staged/${src}/data/ -name "*.dbf" -print`; do
[b]  j=`echo $i | sed 's!.*/!!;s!${src}!${dest}!'`[/b]
  dd if=$i of=/oradata/dut/${dest}/$j bs=262144
done
========================

But it works fine this way:
Code:
#!/usr/bin/ksh93n

src=prod
dest=pprd

rm /oradata/dut/${dest}/*
rm /oractl/dut/${dest}/*
rm /oraredo/dut/${dest}/*

for i in `find  /orabak/staged/${src}/data/ -name "*.dbf" -print`; do
[b]  j=`echo $i | sed 's!.*/!!;s!prod!pprd!'`[/b]
  dd if=$i of=/oradata/dut/${dest}/$j bs=262144
done
===================

I am dealing with several servers and several databases, so hardcoding the source and dest will be a pain in the ass, but doable. If someone would tell me how to make the script recognize the variables in the first example on the bolded line, that would be greatly appreciated. Thanks in advance,
Kelly

 
Thanks! I figured it was something stupid/easy that I wasn't doing.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top