![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl Search and replace entire line | insania | Shell Programming and Scripting | 1 | 05-22-2008 03:45 PM |
| Perl: Global Search and replace | epi8 | Shell Programming and Scripting | 3 | 05-06-2008 12:18 PM |
| Search and replace in Perl | jyoung | Shell Programming and Scripting | 2 | 04-22-2008 10:05 AM |
| Perl: Search for string on line then search and replace text | Crypto | Shell Programming and Scripting | 4 | 01-04-2008 06:24 AM |
| perl search and replace pairs | umen | Shell Programming and Scripting | 1 | 07-30-2006 08:37 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I wanted a perl script to be done for Password search & replace in two files.
For Example: Example 1)--i am having a file such as cat /opt/customer/Ariba/UAT/ariba/app/buyer/Server/config/Parameters.table Example 2)--and i am having a other file in other location such as cat /opt/customer/home/username/CMStaging/UAT-20080304/AR/ServerFiles/opt/customer/Ariba/UAT/ariba/app/buyer/Server/config/Parameters.table the example 1 file contains the string as **REPLACE** the example 2 file contains the live password to be replaced. i want is it should take the live password from the example 2 file & replace that (**REPLACE**)string with the example 1 file. can anyone help me out for some code in detailed for the same on a urgent basis.. Thanks Samir |
| Forum Sponsor | ||
|
|
|
|||
|
actually i have 2 files
example first file contains the live password in it & the second file contains **REPLACE** string after running the script it should automatically take the password from the live file & replace that string of **REPLACE** in the second file the same should be done for Multiple strings.. Please help... Thanks Samir |
|
|||
|
You need to answer my question above and provide more details. The generic answer is get the password from the file it's in, search the other file for the pattern and replace it with the password:
s/\Q**REPLACE**\E/$password/; |
|||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|