<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    bash -c requires one argument: <br>
    <br>
      "/bin/bash" "-c" (acmd+" "+arg)  @stdout=o<br>
    <br>
    <div class="moz-cite-prefix">On 06/26/2014 02:07 PM, Ketan
      Maheshwari wrote:<br>
    </div>
    <blockquote
cite="mid:CAMUuvipRNi+1WZktapQNa8jAz+JzPZ5vyFzSBVyqiKpknAFoDg@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">Thanks!</div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Thu, Jun 26, 2014 at 2:01 PM,
          Wozniak, Justin M. <span dir="ltr"><<a
              moz-do-not-send="true" href="mailto:wozniak@mcs.anl.gov"
              target="_blank">wozniak@mcs.anl.gov</a>></span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF">
              <br>
              Use: <br>
              <div class="">
                <br>
                 "/bin/bash"  "-c" acmd arg @stdout=o<br>
                <br>
                <br>
              </div>
              <div>
                <div class="h5">
                  <div>On 06/26/2014 01:53 PM, Ketan Maheshwari wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <div dir="ltr">Hi,
                      <div><br>
                      </div>
                      <div>The following T script with app def fails for
                        me:</div>
                      <div><br>
                      </div>
                      <div>
                        <div>import files;</div>
                        <div>import io;</div>
                        <div>import string;</div>
                        <div><br>
                        </div>
                        <div>app (file o) cmd (string acmd, string arg)
                          {</div>
                        <div>  "/bin/bash -c" acmd arg @stdout=o</div>
                        <div>}</div>
                        <div><br>
                        </div>
                        <div>main {</div>
                        <div>file output<sprintf("s.txt")> =
                          cmd("echo", "hello");</div>
                        <div>}</div>
                      </div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>
                        <div>CAUGHT ERROR:</div>
                        <div>external command failed: /bin/bash -c echo
                          hello</div>
                        <div>    while executing</div>
                        <div>"error $msg"</div>
                      </div>
                      <div>
                        <div>    (procedure "turbine_error" line 6)</div>
                        <div>    invoked from within</div>
                        <div>"turbine_error "external command failed:
                          $cmd $args""</div>
                        <div>    (procedure "turbine::exec_external"
                          line 16)</div>
                        <div>    invoked from within</div>
                        <div>"turbine::exec_external "/bin/bash -c" [
                          dict create "stdout" ${v:__filename:o} ]
                          ${v:acmd} ${v:arg}"</div>
                        <div>    (procedure "cmd-app-leaf0" line 17)</div>
                        <div>    invoked from within</div>
                        <div>"cmd-app-leaf0 0 {7.0} 1 {1} {4} {file 7
                          is_mapped 1}"</div>
                        <div>Turbine worker task error in: cmd-app-leaf0
                          0 {7.0} 1 {1} {4} {file 7 is_mapped 1}</div>
                        <div>    invoked from within</div>
                        <div>"c::worker_loop $WORK_TYPE(WORK)"</div>
                        <div>    (procedure "worker" line 28)</div>
                        <div>    invoked from within</div>
                        <div>"worker $rules $startup_cmd"</div>
                        <div>    (procedure "enter_mode_unchecked" line
                          5)</div>
                        <div>    invoked from within</div>
                        <div>"enter_mode_unchecked $rules $startup_cmd"</div>
                        <div>    (procedure "enter_mode" line 10)</div>
                        <div>    invoked from within</div>
                        <div>"enter_mode $rules $startup_cmd "</div>
                        <div>CALLING adlb::abort</div>
                        <div>ADLB_Abort(1)</div>
                        <div>MPI_Abort(1)</div>
                        <div>application called
                          MPI_Abort(MPI_COMM_WORLD, 1) - process 1</div>
                      </div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>I want to run an arbitrary command with
                        arbitrary args via /bin/bash or /bin/sh.</div>
                      <div><br>
                      </div>
                      <div>Any suggestions?</div>
                      <div><br>
                      </div>
                      <div>Thanks,</div>
                      <div>Ketan</div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <div class="">
                  <pre>_______________________________________________
ExM-user mailing list
<a moz-do-not-send="true" href="mailto:ExM-user@lists.mcs.anl.gov" target="_blank">ExM-user@lists.mcs.anl.gov</a>
<a moz-do-not-send="true" href="https://lists.mcs.anl.gov/mailman/listinfo/exm-user" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/exm-user</a>
</pre>
                </div>
              </blockquote>
              <span class="HOEnZb"><font color="#888888">
                  <br>
                  <pre cols="72">-- 
Justin M Wozniak
</pre>
                </font></span></div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Justin M Wozniak
</pre>
  </body>
</html>