fork download
  1. #!/bin/bash
  2. s='# comment
  3. # comment
  4. dog=woof
  5. cat=meow
  6. moose=huuuuu #comment
  7.  
  8. # comment
  9. ### comment'
  10. awk -F'=' '!/^[[:space:]]*#/{print $1}' <<< "$s"
Success #stdin #stdout 0.01s 5524KB
stdin
Standard input is empty
stdout
dog
cat
moose