fork download
  1. #!/bin/bash
  2. s='0:0, 80:3, 443:0, 8883:0, 9000:0, 9001:0,
  3. 0:0, 80:0, 443:1, 8883:0, 9000:0, 9001:0,
  4. 0:0, 80:0, 443:0, 8883:0, 9000:0, 9001:0,
  5. 0:0, 80:3, 443:1, 8883:0, 9000:0, 9001:0,
  6. 0:0, 443:0, 8883:0, 9000:0, 9001:0,
  7. 0:0, 80:0, 8883:0, 9000:0, 9001:0,
  8. 0:0, 8883:0, 9000:0, 9001:0,'
  9. awk '/^[0-9]+:[0-9]+(, [0-9]+:[0-9]+)+,$/ && /80/ && /443/' <<< "$s"
Success #stdin #stdout 0.01s 5336KB
stdin
Standard input is empty
stdout
0:0, 80:3, 443:0, 8883:0, 9000:0, 9001:0,
0:0, 80:0, 443:1, 8883:0, 9000:0, 9001:0,
0:0, 80:0, 443:0, 8883:0, 9000:0, 9001:0,
0:0, 80:3, 443:1, 8883:0, 9000:0, 9001:0,