<div dir="ltr"><div><div><div>Ok, I understand the whole &#39;context&#39;, shell thing. I tried what you guys suggested in a terminal window and kind of got the picture. But the way [shell] works remains a mystery to me (even though it&#39;s the same way a teminal window works). I have a few scripts saved in a folder called &#39;scripts&#39; in the &#39;Documents&#39; folder in my home directory. In a terminal window I do the following:<br>
<br></div>cd Documents/scripts/<br></div>sh myscript.sh<br><br></div>and the script runs, no problem. But what the equivalent action with [shell]? The same steps won&#39;t give the same result..<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Jan 29, 2013 at 1:50 PM, Jack <span dir="ltr">&lt;<a href="mailto:jack@rybn.org" target="_blank">jack@rybn.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><div class="im">
    <br>
    -----BEGIN PGP SIGNED MESSAGE-----<br>
    Hash: SHA1<br>
    <br></div>
    Le 29/01/2013 11:59, Alexandros Drymonitis a ←crit :<br>
    <span style="white-space:pre-wrap"><div class="im">&gt; I don&#39;t really understand the
      meaning of &#39;context&#39; (not the actual word, but the way you&#39;re
      using it)..how are these contexts accessible? How are commands
      being executed when sent to the same object?<br>
      &gt;<br>
      &gt;<br></div><div><div class="h5">
      &gt; On Tue, Jan 29, 2013 at 12:41 PM, IOhannes m zmoelnig
      &lt;<a href="mailto:zmoelnig@iem.at" target="_blank">zmoelnig@iem.at</a> <a href="mailto:zmoelnig@iem.at" target="_blank">&lt;mailto:zmoelnig@iem.at&gt;</a>&gt; wrote:<br>
      &gt;<br>
      &gt; On 2013-01-29 11:23, Alexandros Drymonitis wrote:<br>
      &gt; &gt; I checked the help patch of [shell], but if I send a cd
      command<br>
      &gt; &gt; for example, I don&#39;t think that something really
      happens. I<br>
      &gt; &gt; actually would like to run a script from within Pd, but
      what I<br>
      &gt; &gt; understand is that this can&#39;t be really done, is it so?
      Can anyone<br>
      &gt; &gt; demonstrate something like this?<br>
      &gt;<br>
      &gt; that&#39;s exactly the point: with [shell] you _should_ run
      scripts.<br>
      &gt;<br>
      &gt; each command you send to [shell] will open a new &quot;context&quot;.<br>
      &gt;<br>
      &gt; so if you send it a &quot;cd ..&quot;, it will create a new context (in
      your<br>
      &gt; working directory, lets call it ${WD}), move one directory up
      (so we<br>
      &gt; are now in ${WD}/.., report any output (not very much in this
      case),<br>
      &gt; and close the context.<br>
      &gt; if you then send it a &quot;pwd&quot;, it will create a new context (in
      your<br>
      &gt; working directory ${WD}), print the PWD and close the
      context.<br>
      &gt;<br>
      &gt; obviously your &quot;cd..&quot; did not affect &quot;pwd&quot;, as they have been
      executed<br>
      &gt; in different contexts.<br>
      &gt;<br>
      &gt; in order to do anything more complex, you have to create a<br>
      &gt; script-file, and run this via [shell].<br>
      &gt; e.g.<br>
      &gt; &lt;snip&gt;<br>
      &gt; #!/bin/sh<br>
      &gt; cd ..<br>
      &gt; pwd<br>
      &gt; &lt;/snip&gt;<br>
      &gt;<br>
      &gt; and run &quot;myscript.sh&quot; via [shell] should give you ${WD}/..<br>
      &gt;<br>
      &gt; fgamsdr<br>
      &gt; IOhannes<br>
      &gt;<br>
      &gt;<br></div></div>
      &gt; _______________________________________________<br>
      &gt; <a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> <a href="mailto:Pd-list@iem.at" target="_blank">&lt;mailto:Pd-list@iem.at&gt;</a> mailing list<div class="im"><br>
      &gt; UNSUBSCRIBE and account-management -&gt;
      <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
      &gt;<br>
      &gt;<br>
      &gt;<br>
      &gt;<br>
      &gt; _______________________________________________<br>
      &gt; <a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
      &gt; UNSUBSCRIBE and account-management -&gt;
      <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a></div></span><br>
    <br>
    Hello,<br>
    <br>
    By &#39;context&#39;, it is as if you start each time from the beginning
    (same &#39;initialization&#39;).<br>
    You see that when you open a new shell by creating a new terminal
    window :<br>
    1) open new terminal window<br>
    2) enter &#39;cd ..&#39; then return<br>
    3) enter &#39;pwd&#39; then return<br>
    4) close terminal window<br>
    5) open new terminal window<br>
    6) enter &#39;pwd&#39; then return<br>
    <br>
    As you can see the values returned by pwd are not the same because,
    each time you open a terminal window, you open a new shell.<br>
    It is the same under Pd and the object [shell], each time you send a
    message to [shell], each time you open a new shell.<br>
    That&#39;s why you need a script if you need to execute a sequence of
    several commands.<br>
    ++<br>
    <br>
    Jack<br>
    <br>
    -----BEGIN PGP SIGNATURE-----<br>
    Version: GnuPG v1.4.11 (GNU/Linux)<br>
    Comment: Using GnuPG with Thunderbird - <a href="http://www.enigmail.net/" target="_blank">http://www.enigmail.net/</a><br>
    <br>
    iQEcBAEBAgAGBQJRB7eFAAoJEOuluecjw8GU7CoIAJcT9AYfR7QQ1LkrUOmMxTul<br>
    fhqfkhx13MeHa/N30H2D+mHf0iM6OqHcXiVASJcsOinMSyLnPbw313dhuCgmccLl<br>
    vc51hB5nScrSfn+xpOetALxjHXQ9sq+cr8cXboQdGdYEbChyuITAifaN0KihsMWw<br>
    O1+/nSA9bfr9BfMG7G+s+u/u+938a2rU3whp4VdFB5eA0kZkX5YBeD46A6vByBXE<br>
    sxoZg0MlgkKaUdLc60aMrM5LU1PWQmK8aA1QiqEd4ebYF3oN79VxZh7ekkV2DGp2<br>
    KOYxfWHzLLSpPJhDtZDoF1zWJHyhLQ74uIycFwOV+TQOfj3/APD7AN1qXrDwsbQ=<br>
    =II3H<br>
    -----END PGP SIGNATURE-----<br>
    <br>
  </div>

<br>_______________________________________________<br>
<a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br></blockquote></div><br></div>