Squeak scripts in UNIX

Bert Freudenberg bert at freudenbergs.de
Sat Feb 24 19:41:56 UTC 2007


On Feb 24, 2007, at 20:21 , J J wrote:

>> From: Bert Freudenberg <bert at freudenbergs.de>
>> Reply-To: The general-purpose Squeak developers list<squeak- 
>> dev at lists.squeakfoundation.org>
>> To: The general-purpose Squeak developers list<squeak- 
>> dev at lists.squeakfoundation.org>
>> Subject: Re: Squeak scripts in UNIX
>> Date: Wed, 14 Feb 2007 21:51:17 +0100
>>
>>
>>> 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?
>>
>> I was using this:
>>
>> 	case "$2" in
>> 	    /*) DOCUMENT="$2"
>> 		;;
>> 	    *) DOCUMENT="$PWD/$2"
>> 		;;
>> 	esac
>
> Or you could just go:
>
>  "$(pwd)/$(basename $0)"
>
> That should handle the case where $0 is absolute already.

But not if you give a relative path to it, like ../bin/bla

- Bert -





More information about the Squeak-dev mailing list