On Thu, 13 Oct 2016 10:36:22 +0200, Janis Papanagnou wrote:
>> Can I combine these two sub() commands into one?
>
> Yes, the pipe symbol '|' is the logical OR operator.
> (It's documented.)
Seems it doesn't work for me:
$ echo /bin/tun987_vpngate_14.38.19.182_tcp_1702.ovpn |
awk '{sub(/^.*\/|_.*$/, "", $0); print $0 } '
tun987_vpngate_14.38.19.182_tcp_1702.ovpn
$
It should give tun987 as the result, am I wrong at some place?
Regards
>
> Janis