<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Jun 10, 2018, 10:38 Bill Meek <<a href="mailto:keemllib@gmail.com" target="_blank" rel="noreferrer">keemllib@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 06/10/2018 10:46 AM, Klaus Becker wrote:<br>
> I have<br>
> <br>
> #!/bin/sh<br>
> /usr/bin/perl<br>
> /home/klaus/<a href="http://mythlink.pl" rel="noreferrer noreferrer noreferrer" target="_blank">mythlink.pl</a> --link  /home/klaus/multimedia/video/tv/aufnahmen<br>
> <br>
> It starts, but nothing happens and the script will not end.<br>
> <br>
> Both scripts are in /home/klaus<br>
> <br>
> Klaus<br>
<br>
Remove /usr/bin/perl from the script. It appears to hang because perl is<br>
waiting for input from the terminal.<br>
<br>
-- <br>
Bill<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Hi Bill, and Klaus,</div><div dir="auto"><br></div><div dir="auto">The problem you are seeing here is actually an effect of how the email from Greg was formatted, which led to a wrong copy and paste.  While it's correct that Perl was hanging for input from the terminal, this just elaborates a little more as to why, and perhaps gives more information on how to avoid such an issue in the future.</div><div dir="auto"><br></div><div dir="auto">There was only supposed to be 1 actual command line, starting with /usr/bin/perl and then only a single space separating this from /home/klaus/<a href="http://mythlink.pl">mythlink.pl</a> .  Instead, the visual formatting of the email led to /usr/bin/perl being left alone on its own line.</div><div dir="auto"><br></div><div dir="auto">Namely the intent was to put the full path to the Perl interpreter executable in the script to avoid ambiguity, and then naming the full path to the script in your home directory as perl's command line argument: the to-be-interpreted script. </div><div dir="auto"><br></div><div dir="auto">This way, you would not have to make <a href="http://mythlink.pl">mythlink.pl</a> executable to be able to './<a href="http://mythlink.pl">mythlink.pl</a>' or modify its shebang line or any other way of getting it going.  Even if you have made the script executable, it's usually good practice to put the full binary of the script interpreter, in this case Perl, into a command line that is to be run by an automated process without the user shell and environment information loaded.  </div><div dir="auto"><br></div><div dir="auto">If for example, your preferred Perl interpreter is a different version from the (often ancient) system version, if maybe you needed a newer Perl interpreter for whatever purpose, putting the full path to this binary into your script would therefore be required. It's usually just good practice to do this with scripting.</div><div dir="auto"><br></div><div dir="auto">In short, what you're seeing here is an error caused by the minutiae of cut and paste, and the numerous ways that Unix and thereby in similarity, Linux, allows you to make the same thing happen - in this case, running the mythlink script.  </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">#!/bin/sh </div><div dir="auto">'somehow execute the mythlink script with its own --link dirname argument'</div><div dir="auto"><br></div><div dir="auto">Where 'somehow' above depends on a number of things such as your current directory, binary search path, environment, executable mode set on the script, and so on.</div><div dir="auto"><br></div><div dir="auto">Hope this helps</div><div dir="auto"><br></div><div dir="auto">Mike</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>