fork(1) download
  1. #!/bin/bash
  2. s="# Get me some words here
  3. #some words here I don't want
  4. # some words here I need"
  5. grep '^# \([^ ].*\)\{0,1\}some words' <<< "$s"
  6.  
Success #stdin #stdout 0s 19632KB
stdin
Standard input is empty
stdout
# Get me some words here
# some words here I need