<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2016-07-13 21:45 GMT+08:00 Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca" target="_blank">feeley@iro.umontreal.ca</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes that’s one argument (the avoidance of system exploits through some data that is passed to the shell).<br>
<br>
There’s also a portability argument.  Shell escaping varies between platforms (Unix/Windows), and also from one shell to another.<br>
<br>
Moreover, manual shell escaping has always been a nightmare (how many backslashes to add?) that it is best to avoid it completely by letting the implementation do it automatically.  I wouldn’t like a system where the user has to worry about the possibility of arguments containing “$” and “\” and double/single quotes.<br></blockquote><div><br></div><div>Ah those are fantastic arguments for it to be like it is now too.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So for your use-case I would suggest:<br>
<br>
> (define (pkg-config-lib name)<br>
    (call-with-input-process<br>
      (list path: "pkg-config" arguments: (list "--libs" name))<br>
      read-line))<br>
> (pkg-config-lib "zlib")<br>
"-lz"<br>
> (compile-file "test.scm" ld-options: (pkg-config-lib "libjpeg"))<br></blockquote><div><br></div><div>Yup perfect.</div><div><br></div><div>Thanks!</div><div><br>Best regards</div><div><br></div></div></div></div>