title: Sh Permission denied
body: <p>Below code embedded in executable.
  i have placed the executable in /usr/bin/ directory with 777 permission given to the executable.</p>
  
  <p>I am using beagle bone black. when i try to execute the linux applicaion</p>
  
  <pre><code>/usr/bin/app
  </code></pre>
  
  <p>which in turn calls internally the script Chk_File.sh fails. throws an error permission denied sh:Chk_File.sh.</p>
  
  <pre><code>if(!(system("ls /home/ubuntu/Desktop/BIN/BB")))
      {
      /* Test Path : remove after testing */
      dw_flag = system("/home/ubuntu/Desktop/BIN/BB/Chk_File.sh");//Call to execute Script
      dw_flag = WEXITSTATUS(dw_flag); 
      }
  </code></pre>
  
  <p>i have tried giving the chmod 777 permission at all places still it fails.</p>
  
  <p>this is the script</p>
  
  <pre><code>#!/bin/sh
  
  
  &lt;&lt;BB_SCRIPT_INFO
  
      This Script Will Check if required files are placed in the directory
  
  BB_SCRIPT_INFO
  
  
  
  ret_val=0
  
  DIR=$(dirname $0) ;
  
  
  echo $DIR
  
  if [ ! -f $DIR/ACTION_TAG.txt ]
  then
    echo " ACTION_TAG NOT PRESENT "
  else
      ret_val=1       
  fi
  
  echo $ret_val
  exit $ret_val
  </code></pre>
  
  <p>Please advise how can i get rid of this error.</p>