fork download
  1. #!/bin/bash
  2. s='This is the first sample line 1
  3. this is the second sample line
  4. another line
  5.  
  6. total lines: 3 tot'
  7.  
  8. awk '/^total lines:/{print $3; exit}' <<< "$s"
Success #stdin #stdout 0.01s 5696KB
stdin
Standard input is empty
stdout
3