title: child_process exec command is getting executed multiple times
body: <p>I am using <code>exec()</code> to run a terminal command to show dialog in electron mac application.</p>
  
  <p><strong>The code I am using:</strong></p>
  
  <pre><code>var exec = require('child_process').exec;
  var request = require('request');
  
  request('https://server_url', function (error, response, data) {
  
      console.log("inside request");
  
      exec(`osascript -e 'with timeout of 86400 seconds
                                      tell app "System Events"
                                          display dialog "` + data.pop_up_message + `" buttons {"OK", "Cancel"} 
                                      end tell 
                                  end timeout'
      `, function(error, stdout, stderr){
  
          console.log("inside exec");
  
      });
  
  });
  </code></pre>
  
  <p>Its showing multiple dialogs in a single request. </p>
  
  <p><strong>Console output:</strong></p>
  
  <pre><code>inside request
  inside exec
  inside exec
  inside exec
  </code></pre>
  
  <p>Here <code>'inside request'</code> is getting printed only once. But the <code>'inside exec'</code> is getting printed multiple times. 
  What is the reason for this issue. How can I solve this.</p>