Unix scripts change

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
reddysrc
Participant
Posts: 39
Joined: Mon May 30, 2005 3:19 pm

Unix scripts change

Post by reddysrc »

Hi Experts,

I had 150 unix (AIX) shell scripts in dev directory, i need to change of some params in all scripts ( like /opt/dataste/prod to /opt/datastage/dev ) path names in all shell scripts.

Is there any single unix command to replace "prod" with "dev" .

let me know possible unix commands to change all shell scripts patchs with a singe shot.

Thanks
Rama
trammohan
Participant
Posts: 47
Joined: Thu Nov 13, 2003 12:47 pm

Post by trammohan »

/opt/dataste/prod to /opt/datastage/dev

Hi ,

try this one

for i in `ls *.ksh`
do
sed 's/\/opt\/datastage\/prod/\/opt\/datastage\/dev/g' $i > ${i}_new
mv ${i}_new $i
done

hope this helps.....
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Perhaps just 's/prod/dev/g' and as not the whole path.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Make sure you save a copy of them all before you start, just in case this destroys them all. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Always Craig hopes the best!
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I suspect it's more to do with not having to spend lots of non-billable time re-creating what's been destroyed.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply