Hello,<div><br></div><div>I'm trying to map .sh files and directly execute them by sh myfile.sh but encounter some errors here. Could anyone help?</div><div><br></div><div>####Contents of test.swift####</div><div><br></div>
<div><div>type SHL {};</div><div><br></div><div>SHL shellarray[] <ext;exec="mapper.sh">;</div></div><div><br></div><div><div>/*app ( SHLout out )shellexecute ( SHL s ){</div><div> sh @filename(s) stdout=@filename(out); // Could anyone add comments for these lines ? I'm not sure whether an out file is necessary</div>
<div>}*/</div><div><br></div><div>app simpleshellexec(SHL s){</div><div> sh @filename(s); // Is this app written correctly?</div><div>}</div></div><div><br></div><div><div>foreach s in shellarray {</div><div><br></div>
<div> simpleshellexec(s);</div><div><br></div><div>}</div></div><div><br></div><div>#####Contents of mapper.sh#####</div><div><br></div><div>#!/bin/bash</div><div><br></div><div>echo "[0] 0.sh"</div><div>
echo "[1] 1.sh"</div><div><br></div><div>#############################</div><div><br></div><div>I'm expecting 0.sh and 1.sh can be run under current directories. Any corrections/ suggestions from anyone?</div>
<div><br></div><div>Thank you.</div><div><br></div><div>Weiyang</div>