(/usr/lib/lpd/pio/etc/piolsvp -q 2>&1| sort | awk '$0 !~ /^#/ { if ( $1 ~ /^A/ || /^O/ || /^R/ || /^S/ ) { { if ($1 ~ /-$SYS3D_DC_SITE.*)?$/)
print $1 ; else next } } print $1 }' 2>&1)
Output
-----------
OLB2-DV08
OLB2-DV09
U4910
u4812
Should be:
---------
A045-DV08
A045-DV09
OLB2-DV08
OLB2-DV09
U4910
u4812
Whats wrong in the above "awk" command -
The first "if command" misses the first search pattern "A"
Kindly help, im a starter with the awk programming.
Thanks in advance!!
print $1 ; else next } } print $1 }' 2>&1)
Output
-----------
OLB2-DV08
OLB2-DV09
U4910
u4812
Should be:
---------
A045-DV08
A045-DV09
OLB2-DV08
OLB2-DV09
U4910
u4812
Whats wrong in the above "awk" command -
The first "if command" misses the first search pattern "A"
Kindly help, im a starter with the awk programming.
Thanks in advance!!