fork download
  1. #!/bin/bash
  2.  
  3. export VAR="some text"
  4.  
  5. string="THING = '$VAR '"
  6. substring="THING = '$VAR '"
  7.  
  8. if [[ "$string" =~ "$substring" ]]; then
  9. echo "True"
  10. else echo "False"
  11. fi
  12.  
Success #stdin #stdout 0.02s 5268KB
stdin
Standard input is empty
stdout
True