Squeak scripts in UNIX

Ken Causey ken at kencausey.com
Wed Feb 14 20:32:00 UTC 2007


On Wed, 2007-02-14 at 15:12 -0500, Lex Spoon wrote:
> That said, that's very interesting that using the absolute path works
> already.  Maybe the easiest thing, then, is to come up with some
> shell-script magic to rewrite $0 into an absolute path.  Do any Unix
> hackers here know how to do that?
> 
> -Lex

First of all let me say that I've been paying only the barest of
attention to this thread so I could be offbase here, and I'm not exactly
a shell guru...

#!/bin/sh
exec squeak -headless -- `pwd`"/$0" "$@"
!#

Not pretty, but I believe that would do the trick.  However I'm not sure
that pwd will work in the desired manner in all situations.  Also, some
logic is needed here to ascertain that $0 is not already an absolute
path.

Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20070214/ce835c1d/attachment.pgp


More information about the Squeak-dev mailing list