Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Unix question
No No . Here is full problem
I have this ini file called xyz.ini having
hostname = $HOSTNAME$.acme.com
schemaname=$SCHEMANAME$
domainname= $HOSTNAME$.foo.bar.com
okay , Now I am getting the values of hosname as
"abc" , schema name as "schem" .
I want to write a script in which I will pass these
parameters and they will do a search and replace kindof operation.
I was thinking of using sed , but how to get rid of
quotes because my $1 is "abc" so after replacement file will become
hostname = "abc".acme.com
schemaname="schem"
domainname= "abc".foo.bar.com
while I want it to be like
hostname = abc.acme.com
schemaname=schem
domainname= abc.foo.bar.com
- Big Planet
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
To: <A href="mailto:ORACLE-L_at_fatcity.com"
title=ORACLE-L_at_fatcity.com>Multiple recipients of list ORACLE-L
Sent: Friday, March 23, 2001 8:45
PM
Subject: Re: Unix question
Yes & no.
There are a couple of different way to solve the problem. 1) Write your
own functions/filters to accomplish the desired operations 2) If the only
place in the file where double quote marks exists are around the hostname
and all you want to do is get rid of them, the "tr"
command could be used. 3) Unix scripts can accept command line arguments
which are positionally dependant so you could create a master script which
would look like the following driver.sh host1 schemaA driver.sh host2
schemaB driver.sh host9 schemaG etc.......................The inside driver.sh where you want the hostname to appear place a $1 The inside driver.sh where you want the schema to appear place a $2
Hi geeks ,<FONT
face=Arial>How can I do substr and instr kind of operaion in
unix shell script . is it possible ?<FONT
size=-1>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 .<FONT
size=-1>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. <FONT
size=-1>TIA--Big
planet
Received on Fri Mar 23 2001 - 22:31:34 CST
![]() |
![]() |