|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Replace a value in the file that start with quotes
I have to replace the specific encypted [LL9@99V@N=3M0O4I4;J43KH6] value in the file which is will be a taken as input from user always.PADWD appears two times in the document of which I need to replace the line which start with double quotes. Please help. Code:
"PADWD"\1\"LL9@99V@N=3M0O4I4;J43KH6"---Sample line in the file. Thanks Chand Last edited by Scrutinizer; 06-25-2012 at 04:26 PM.. Reason: code tags |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
And what output do you want from that?
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Once the value is inserted i will be running a related job for which I have tested command and is running fine. Please help me with insert code. Thank you.
|
|
#4
|
|||
|
|||
|
Yes, but what output do you want? Show it, don't just describe it.
|
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
Old value in the file ---> Code:
"PADWD"\1\"LL9@99V@N=3M0O4I4;J43KH6" New encrypted value taken as input - Code:
LL9@99V@N=34566666 Expected output- Code:
"PADWD"\1\"LL9@99V@N=34566666" . Please help. Last edited by Scrutinizer; 06-25-2012 at 04:27 PM.. |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
Code:
VAR="LL9@99V@N=34566666"
OLDIFS="$IFS"; IFS="="
set -- $VAR
IFS="$OLDIFS"
awk '/"PADWD"/ && ($0 ~ P1) { sub(/"[^="]*=[^"]*"$/, "\"" P1 "=" P2 "\""); } 1' P1=$1 P2=$2 inputfile > outputfile |
| The Following User Says Thank You to Corona688 For This Useful Post: | ||
chandu123 (06-26-2012) | ||
| Sponsored Links | |
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search replace strings between single quotes in a text file | Hiano | Shell Programming and Scripting | 7 | 07-15-2011 10:35 AM |
| How to replace double quotes in to ascii value? | rajesh4851 | UNIX for Dummies Questions & Answers | 4 | 05-11-2011 03:27 AM |
| sed replace spaces between quotes with a variable | EXT3FSCK | Shell Programming and Scripting | 3 | 03-07-2010 12:22 AM |
| replace value with double quotes of specific coulmn value in csv file | techmoris | Shell Programming and Scripting | 3 | 08-03-2009 09:37 PM |
| Replace multiple blanks within double quotes | jgrogan | Shell Programming and Scripting | 5 | 07-14-2008 09:54 AM |
|
|