title: Delete a specific node in a linked list
body: <p>Need to search for the specific node and then and delete, but for some reason this code doesn't end up changing the node that needs to be deleted. cmdNum is just the position of the node not a value in the struct.</p>
  <pre><code>CmdNode *deleteCommand(CmdNode *head, int cmdNum) {
   
  
      CmdNode *temp1 = NULL;
      CmdNode *temp2 = NULL;
      
      temp1 = head;
      temp2 = head -&gt; next;
      
      
      int pos = 0;
      
      while (temp2!= NULL){  
          
          if(cmdNum == pos){
              
              
              temp1 -&gt;next = temp2-&gt;next;
              free(temp2);
              
              
              return head;
          }   
          temp1 = temp1-&gt;next;
          temp2 = temp2-&gt;next;
          pos++;
      }
     
  
    return head;
  }
  </code></pre>