<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">When I distribute the script together with my<br>
Pd project, I'd rather want it relative to the patch, otherwise the<br>
script won't be found on other users' machines.</blockquote><div><br></div><div>As you need [ggee/shell], then why not using also [ggee/getdir] to know where your patch is located ?<br><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><font face="arial, helvetica, sans-serif"> Antoine Rousseau </font></div><div dir="ltr"><font face="arial, helvetica, sans-serif">  <a href="http://metalu.net" target="_blank">http://www.metalu.net</a> __ <a href="http://www.metaluachahuter.com/compagnies/al1-ant1/" target="_blank">http://www.metaluachahuter.com/</a><br><br></font></div></div></div></div></div></div>
<br><div class="gmail_quote">2017-05-29 13:28 GMT+02:00 Roman Haefeli <span dir="ltr"><<a href="mailto:reduzent@gmail.com" target="_blank">reduzent@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, 2017-05-29 at 13:03 +0200, Antoine Rousseau wrote:<br>
> > And does anybody know if any of them are blocking so that the<br>
> > timing of an external script is deterministic from within Pd's<br>
> > logical timeframe?<br>
> afaik only [system] is blocking, while [shell] and [popen] use Pd<br>
> polling system through Pd main loop.<br>
><br>
>  <br>
> > I find it hard to kill a still running command, especially when I<br>
> > want to kill a specific one when many are running.<br>
> I would suggest writing your own script, that would call jacktrip,<br>
> and which would take an additional (but ignored) ID parameter, which<br>
> could then be used to identify each of the processes, to allow<br>
> killing them individually with pkill.<br>
><br>
> For instance:<br>
><br>
> [my_script.sh ID1 ACTUAL_PARAMETERS &]<br>
> |<br>
> [shell or system or popen]<br>
><br>
> then:<br>
><br>
> [pkill -f my_script.sh ID1 &]<br>
> |<br>
> [shell or system or popen]<br>
<br>
</span>I am currently using the following script that outputs the command's<br>
PID (thanks to Jack for his help in this):<br>
<br>
<br>
#!/bin/bash<br>
while read line<br>
do<br>
    echo "$line"<br>
done < <($@ 2>&1  & echo "PID $!")<br>
<br>
<br>
Using a script has its own complications, though. Unfortunately,<br>
[shell] opens scripts relative to Pd's start location. So using a local<br>
script is not portable. When I distribute the script together with my<br>
Pd project, I'd rather want it relative to the patch, otherwise the<br>
script won't be found on other users' machines.<br>
<br>
I am still not quite satisfied with the available options yet. Will<br>
experiment/think some more.<br>
<br>
Anyway, thanks a lot for your thoughts.<br>
<span class="HOEnZb"><font color="#888888"><br>
Roman<br>
<br>
<br>
</font></span></blockquote></div><br></div>