Search Results

Search: Posts Made By: KDDubai333
3,191
Posted By Scrutinizer
Another awk approach: awk 'NR==FNR{A[$1]=$2;...
Another awk approach:
awk 'NR==FNR{A[$1]=$2; next} $1=="value" && $2 in A{f=A[$2]} $1=="password-encrypted" && f {$2=f; f=x} FNR>1{printf "<%s",$0}' file2 RS=\< FS=\> OFS=\> file1

More readable:...
3,191
Posted By RavinderSingh13
Hello KDDubai333, It is working fine for me...
Hello KDDubai333,

It is working fine for me and I have tested with different examples too.


awk -vs1="<password-encrypted>" -vs2="</password-encrypted>" 'NR==FNR{a[$1]=$2;next} (v in...
3,191
Posted By SriniShoo
awk 'NR == FNR{split($0, t, /[$][$][$]/); a[t[1]]...
awk 'NR == FNR{split($0, t, /[$][$][$]/); a[t[1]] = t[2]; next} /<value>/ {split($0, t, />|</); v=t[3]} /<password-encrypted>/ {sub(/>.*<\//, ">" a[v] "</")}1' passwd file

for the modified passwd...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 06:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy