0

I want to the delete everything after hyphen "e-" in the last column output..

Below is what my output looks like..

# awk '/out: OpenSSL/ { gsub( /[][]|out:/ , "" ) ;  print $1,$2,$3 }' sslcheck.log | column -t

myserver1                         OpenSSL  1.0.1e-fips
myserver2                         OpenSSL  0.9.8e-fips-rhel5

I want everything to be deleted in the last column after char+hyphen(e-)..

Desired output..

myserver1                         OpenSSL  1.0.1
myserver2                         OpenSSL  0.9.8
Karn Kumar
  • 105
  • 4

1 Answers1

0

use awk sub-string function to extract the first three characters from the column three.

# awk '/out: OpenSSL/ { gsub( /[][]|out:/ , "" ) ;  print $1,$2,substr($3,0,3)}' sslcheck.log | column -t
krock1516
  • 128
  • 1
  • 5