I tried to run the expect script with the set command and it gave me a error. This is copied from another script file. Usually the set command doesn't have the ( ) around the variable..so is it a correct syntax or I have a wrong tcl version
Thanks
set g(NodeId) [lindex $argv 0]
set g(Card)...
CaKiwi and PHV
Thank you both for your tremendous help !!!
I used your scripts and they work great.
I put in the check in the bourne shell for other things...
Cheers
Loc
CaKiwi
Here is the portion of the content of the actual text file. I would like to find any instance of cvr_public_ip="0.0.0.0"
and tunnel_ip="0.0.0.0" and replace the 0.0.0.0 with the new ip address read in from a file. #.#.#.# will be a different number for every new instance found
ie...
Sorry I wasn't clear on the question
There are other text strings in the file and I only want to find a certain string pattern and replace it. The string pattern could be anywhere in the file like below...
fafaf
afadfadkskfj
string_to_replaced
adfadfja
fafadsaf
dafdsa
string_to_replaced
With...
Sorry the output of my script should look like this instead
first_line
10.1.1.3 end_of_line next_string
10.0.0.0 end_of_line my_string
10.0.0.0 end_of_line my_string
the_rest
Hello
I need help with replacing string in a text file with another string read from another file.
I have the following
file1
first_line
10.0.0.0 end_of_line mystring
10.0.0.0 end_of_line mystring
10.0.0.0 end_of_line mystring
the_rest
file2
10.1.1.1 next_string
10.1.1.2 next_string...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.