Computing.Net > Forums > Unix > output of a cmd>replace a line

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

output of a cmd>replace a line

Reply to Message Icon

Name: arun.s
Date: November 16, 2005 at 05:02:24 Pacific
OS: unix
CPU/Ram: 255
Comment:


Hi,

i have a script which will generate som encrypted pwd and i need to replace this pwd to the existing one in a file.

generatencrypt=arundatabase will generate password as 3490327483274893789

and my sample file is sample.ksh
DBPASS=90904373739049
DBUID=testdatabase

i need to replace DBPASS=90904373739049 by newly generated password.. i tried the following command. but its not working properly. the command i used is
generatencrypt=arundatabase|sed "s/^DBPASS=[0-9]*$/DBPASS= /g" sample.ksh

if i can place that newly generated encrypted password in place of */DBPASS=?????/g' (here) problem is solved...


i m looking after for someones help.. send me the solution as soon as possible

thanks in advance
Arun




Sponsored Link
Ads by Google

Response Number 1
Name: koala95
Date: November 16, 2005 at 07:10:26 Pacific
Reply:

I can't understand that generatencrypt=arundatabase.
I guess u want to generate a password by pass a parameter(arundatabase) to generatencrypt. if as I think that. you can do like a previous reply
#/bin/ksh
passwd=`generatencrypt arundatabase`
sed "s/DBPASS.*/DBPASS=$passwd/" sample.ksh

My Email:old_bear40@yahoo.com


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: output of a cmd>replace a line

Redirecting the output of a PL/SQL www.computing.net/answers/unix/redirecting-the-output-of-a-plsql-/8224.html

line by line processing of output www.computing.net/answers/unix/line-by-line-processing-of-output/5124.html

Saving Output of Sed www.computing.net/answers/unix/saving-output-of-sed/7542.html