awk command displays duplicates
or is it my do command:
herewith is the output run with ksh -x:
Code:
awk 'BEGIN {while ( getline < "sun5-printers.txt") {arr[$0]++ } } { if (!($0 in a
rr ) ) { print } }' sun8-printers.txt > diffs.txt
or is it my do command:
Code:
for i in `cat diffs.txt`
do
printer="$(awk -F: '{print $1}' | cut -c11-18 diffs.txt)"
echo $printer
done
herewith is the output run with ksh -x:
Code:
+ cat diffs.txt
+ + cut -c11-18 diffs.txt
+ awk -F: {print $1}
printer= 0117bd1
2201bl7
5001bl1
+ echo 0117bd1 2201bl7 5001bl1
0117bd1 2201bl7 5001bl1
+ + cut -c11-18 diffs.txt
+ awk -F: {print $1}
printer= 0117bd1
2201bl7
5001bl1
+ echo 0117bd1 2201bl7 5001bl1
0117bd1 2201bl7 5001bl1
+ + cut -c11-18 diffs.txt
+ awk -F: {print $1}
printer= 0117bd1
2201bl7
5001bl1
+ echo 0117bd1 2201bl7 5001bl1
0117bd1 2201bl7 5001bl1