title: Cause of sh: 1 file not found error with system() command? Tried possible solutions in StackOverflow (listed below) but failed
body: <p>Based on the answers in StackOverflow, I used system command in a C program to invoke matrix.sh in the following possible ways:</p>
  
  <p>1)    system("./matrix.sh") </p>
  
  <p>2)    int ret=system("./matrix.sh") </p>
  
  <p>3)    system("cd /path/to/matrix.sh; ./matrix.sh &amp;") </p>
  
  <p>4)    system("./matrix.sh>> outputfilename") </p>
  
  <p>5)    system("Path/to/matrisx.sh")</p>
  
  <p>6)    system("bash/Path/to/matrix.sh")</p>
  
  <p>and a few others. But all of these give the SAME error. sh:1: Matrix.sh not found and another error (except in 2nd case) as
   warning: ignoring return value of 'system', declared with attribute warn_unused_result [-Wunused-result]</p>
  
  <p>The paths of the invoking C program and the [input .sh script, expected output file] are different. How to write the system() command in this situation? What is the cause of this error?</p>