title: How to fork in a bash script
body: <p>Hi i have a school project where I need to create a command line using an exec through a child process. i am scripting in bash.</p>
  
  <p>here is my pseudocode:</p>
  
  <pre><code>while true; do
  read -p "Please type your Linux command. Type q to quit." lnxcmd
  case $lnxcmd in
   ([Qq]*) exit;
  esac
  
  CREATE FORK
  FIND CHILD PROCESS
  IN CHILD PROCESS- 
    tokenize into array A, split at " "
    get size of array in n
    aggregate everything from 1 .. n as variable B
    exec A[0], B
  display result, and kill child process
  </code></pre>
  
  <p>and the loop goes on until q has been pressed. since i am not using c, i cant create a pid_t variable and assign it to fork() and get to the child process like that.</p>
  
  <p>how can i get to the child process using bash commands? also, what is the proper syntax of exec for bash commands?</p>
  
  <p>thanks</p>