fork download
  1. #!/bin/bash
  2. s="345-103832 OI.S.15.0FKOGO
  3. 345-103832 OX.S.5.0FKOGO
  4. 345-103832 QX.S.3.0FKOGO
  5. 345-103832 Qa.S.21.0FKOGO
  6. 345-114643 IX.S.13.0FKOGY"
  7. awk '$2 !~ /^.?[OI]/' <<< "$s"
  8.  
  9. # need to print all lines that column 2 does not start with "O", with "I" or have an "O or "I" as
  10. #part of the first two letters.
Success #stdin #stdout 0s 23336KB
stdin
Standard input is empty
stdout
345-103832 QX.S.3.0FKOGO  
345-103832 Qa.S.21.0FKOGO