To be precise, $0 always contains the path to the program called. You are right, this path will change depending on location from which the program was called. So $0 is OK for my case, while current directory  is unrelated.<br>
<br>Try this:<br><br>#!/bin/sh                                                                                                             <br>echo &quot;Arg 0: $0&quot;<br>echo &quot;All Parameters:  [$@]&quot;<br> <br>Again, any way to get the same functionality in GHC?<br>
<br><br><div class="gmail_quote">On Thu, Dec 1, 2011 at 10:32 PM, Giovanni Tirloni <span dir="ltr">&lt;<a href="mailto:gtirloni@sysdroid.com">gtirloni@sysdroid.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Thu, Dec 1, 2011 at 5:26 PM, dokondr <span dir="ltr">&lt;<a href="mailto:dokondr@gmail.com" target="_blank">dokondr@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


On the contrary, standard shell variable $0 - contains a full path to the program location in the directory structure, no matter from what directory the program was called.<br><br></blockquote><div><br></div></div><div>Are you sure?</div>


<div><br></div><div><div>$ zero.sh</div><div>./zero.sh</div></div><div><br></div><div><div>$ ./zero.sh</div><div>./zero.sh</div><div><br></div><div>$ /home/gtirloni/zero.sh</div><div>/home/gtirloni/zero.sh</div></div><div>


<br></div><div><br></div></div><font color="#888888"><div><br></div>-- <br>Giovanni<br><br><br>
</font></blockquote></div><br><br clear="all"><br>