Search Results

Search: Posts Made By: ranrodrig
2,906
Posted By durden_tyler
$ $ $ cat file1 host xxxxxx "" 0,0 Closed...
$
$
$ cat file1
host xxxxxx "" 0,0 Closed control00/ SOLARIS 0x0+0+0 "TCP"
host yyyyyy "" 0,0 Closed control01/ SOLARIS 0x0+0+0 "TCP"
host 222222 "" 0,0 Closed control30/ Linux 0x0+0+0 "TCP"
$...
2,906
Posted By ygemici
#!/bin/bash for i in $(sed 's/\(.*\) .*/\1/'...
#!/bin/bash
for i in $(sed 's/\(.*\) .*/\1/' file2)
do
x=$(sed -n "/$i/s/.* \(.*\)/\1/p" file2)
sed -n "/$i/s/\(.*\)\/ \(.*\)/\1\/$x \2/p" file1 >> file3
done
more file3

host...
2,906
Posted By vgersh99
nawk ' FNR==NR { f1[$1]=$2;next } ...
nawk '
FNR==NR { f1[$1]=$2;next }
(s=substr($6,1,length($6)-1)) in f1 {$6=$6 f1[s];print}
' file2 file1 > file3
Showing results 1 to 3 of 3

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