Squeak scripts in UNIX

Norbert Hartl norbert at hartl.name
Thu Feb 15 09:40:20 UTC 2007


On Wed, 2007-02-14 at 15:12 -0500, Lex Spoon wrote:
> Bert Freudenberg <bert at freudenbergs.de> writes:
> > The harder part is that there is no concept of a current working
> > directory in Squeak. To find the script, you need to convert a
> > relative path to the absolute one using cwd. This can either be done
> > in the shell script, or one could abuse the SecurityPlugin which
> > listens to environment variables ... or extend the VM ... or use
> > OSProcess ...
> 
> On Unix, "FileDirectory default" gives you the Unix cwd.  And at any
> rate, this is the "default" directory, so it is at least a defensible
> place to start if you are given a relative path.
> 
> 
> 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?
> 
$PWD/$0

always resemble an absolute path.

Norbert




More information about the Squeak-dev mailing list