fork download
  1. #!/bin/bash
  2. s='abc|87123
  3. cdb|
  4. fgytw|23321
  5. ghft|
  6. |87635'
  7. awk -F\| 'length($1){c++} END{print c}' <<< "$s"
Success #stdin #stdout 0.01s 5436KB
stdin
Standard input is empty
stdout
4