title: using bash to execute a group of commands from C without storing them in a file
body: <p>I've got a program which accepts a set of rules in the form of a single rules file.</p>
  
  <p>When one of the conditions are considered met by my program, I seek to treat the block of commands associated with the condition as an independent bash script which needs to be executed. I would rather not deal with storing these commands in files as that leaves an undesirable attack vector. Is there a way to feed a line delimited list of bash commands to bash as a single group? I want if conditions and other things from the bash script to function correctly, not just executing each line raw on its own.</p>
  
  <p>Example rules file:</p>
  
  <pre><code>if CONDITION
  some nice
  bash commands
  pkill some process
  ./launching something!
  endif
  </code></pre>
  
  <p>I want to be able to run the four lines of bash code as a group of bash commands, not independently of each other, when CONDITION is true, as determined by my C program.</p>
  
  <p>Obviously this is from Linux, using C as the programming language.</p>