title: SonarQube Scanner fails in a Jenkins pipeline command not found
body: <p>I'd like to run SonarQube Scanner from a Jenkins pipeline and I followed the documentation.</p>
  <p>Regarding the error, it seems that the scanner is present but some commands are not found. My jenkins instance runs in local.</p>
  <p><strong>error message :</strong></p>
  <pre><code> + /usr/local/bin/sonar-scanner
  /usr/local/Cellar/sonar-scanner/4.6.2.2472_1/libexec/bin/sonar-scanner: line 17: dirname: command not found
  /usr/local/Cellar/sonar-scanner/4.6.2.2472_1/libexec/bin/sonar-scanner: line 18: basename: command not found
  /usr/local/Cellar/sonar-scanner/4.6.2.2472_1/libexec/bin/sonar-scanner: line 28: dirname: command not found
  File does not exist: //lib/sonar-scanner-cli-4.6.2.2472.jar
  '/' does not point to a valid installation directory: /
  [Pipeline] }
  [Pipeline] // stage
  [Pipeline] }
  [Pipeline] // node
  [Pipeline] End of Pipeline
  ERROR: script returned exit code 1
  Finished: FAILURE
  </code></pre>
  <p><strong>script pipeline :</strong></p>
  <pre><code>    node {
      stage('Preparation') {
          try{
              
          // Clone Project from bitbucket
          git url: 'https://test@bitbucket.org/test/test.git'
          
          }catch(err){
              echo err
          }
      }
      
  stage('Sonarqube') {
    
        sh '/usr/local/bin/sonar-scanner'
  
         
  }
      
      stage('end') {  
       echo &quot;Success&quot; 
      }
  }
  </code></pre>