this is ksh93 syntax (at least on Sun):
 
1453:oracle@e6500b> ksh
1453:oracle@e6500b> var=tester
1453:oracle@e6500b> echo ${var//e/o}
ksh: ${var//e/o}: bad substitution

1453:oracle@e6500b> dtksh
1453:oracle@e6500b> var=tester
1453:oracle@e6500b> echo ${var//e/o}
tostor
1453:oracle@e6500b>
-----Original Message-----
From: Mandar Ghosalkar [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 23, 2001 8:05 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: Unix question

check this question from korn faq at
 
Q24. How do I do global substitutions on the contents of shell variables?
A24. Use // instead of / for global substitution, ${var//aa/bb} will
expand to the value of  with each "aa" replace by "bb".
so i tried
$ var=tester
$ echo $var
tester
$ echo ${var//e/o}
bad substitution
$
 
anyone out there :)
 
-Mandar
 
-----Original Message-----
From: Big Planet [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 23, 2001 7:56 PM
To: Multiple recipients of list ORACLE-L
Subject: Unix question

Hi geeks ,
How can I do substr and instr kind of operaion in unix shell script . is it possible ?
like i have one paramter as "hostname" .. I want to trim quotes surrounding the hostname .
One more question , is possible to read another text file line by line using a shel script and then edit that file .
Actually I have this configuration file for my system which have keywords like $HOSTNAME$ , $SCHEMA$ which I want to replace with actual values at the time of installation by asking questions to the user.
 
TIA
--Big planet
 

 

Reply via email to