Squeak scripts in UNIX

J J azreal1977 at hotmail.com
Sat Feb 24 19:21:12 UTC 2007


>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.

_________________________________________________________________
Play Flexicon: the crossword game that feeds your brain. PLAY now for FREE.  
  http://zone.msn.com/en/flexicon/default.htm?icid=flexicon_hmtagline




More information about the Squeak-dev mailing list