@Bill,
Shouldn't that be "10.6" ?
As you've given it, it returns: cat.
But if I change the script to this:
#!/bin/sh
f=`sw_vers -productVersion`
if [ "10.6" = ${f%.*} ]; then
echo 'lion'
else
echo 'cat'
fi
echo dollar-f $f
echo dollar-f-part ${f%.*}
...here's what I get back:
bash-3.2$ ~/tryme
lion
dollar-f 10.6.5
dollar-f-part 10.6
Ian
On Sun, Dec 5, 2010 at 8:41 AM, bill lam <[email protected]> wrote:
> It is interesting that a 64-bit os saying machine is a i386.
>
> anyhow we perhaps compare the major version 1.6
> please try if this works or not.
>
> #!/bin/sh
> f=`sw_vers -productVersion`
> if [ "1.6" = ${f%.*} ]; then
> echo 'lion'
> else
> echo 'cat'
> fi
>
> Вск, 05 Дек 2010, Ian Clark писал(а):
>> Just been trying to solve this problem myself -- and trying too learn
>> bash at the same time.
>>
>> Here's what I get on my iMac running Snow Leopard ...
>>
>> bash-3.2$ uname
>> Darwin
>> bash-3.2$ uname -a
>> Darwin ian-clarks-imac.home 10.5.0 Darwin Kernel Version 10.5.0: Fri
>> Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386
>> bash-3.2$ uname -m
>> i386
>> bash-3.2$ uname -n
>> ian-clarks-imac.home
>> bash-3.2$ uname -p
>> i386
>> bash-3.2$ uname -r
>> 10.5.0
>> bash-3.2$ uname -s
>> Darwin
>> bash-3.2$ uname -v
>> Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010;
>> root:xnu-1504.9.17~1/RELEASE_I386
>> bash-3.2$ sw_vers
>> ProductName: Mac OS X
>> ProductVersion: 10.6.5
>> BuildVersion: 10H574
>> bash-3.2$ sw_vers -ProductVersion
>> Usage: sw_vers [-productName|-productVersion|-buildVersion]
>> bash-3.2$ sw_vers -productVersion
>> 10.6.5
>>
>> What I deduce from this is:
>> 1. uname doesn't know the correct product version (10.6.5 according to
>> my Apple Menu > About This Mac)
>> 2. The most useful source of info is: sw_vers -productVersion (NB the
>> problem starts with 10.6.0)
>>
>> I leave it to you, Bill, to suggest the necessary arithmetic inside:
>> if [...] ... fi.
>>
>> Might the -j32 flag actually be disruptive if you go back before
>> 64-bit java was released? (10.5 was it?) Or on non-Intel Macs?
>>
>> Ian
>>
>>
>>
>> On Sat, Dec 4, 2010 at 4:49 PM, bill lam <[email protected]> wrote:
>> > I guess one could use a conditional statement,
>> > if [ "x86_64" = `uname -m` ]; then
>> > java for snow leopard, lion
>> > else
>> > java for old cats
>> > fi
>> >
>> > not sure what is the output of uname -m for oxs
>> >
>> > Сбт, 04 Дек 2010, Ian Clark писал(а):
>> >> Won't J7 for the Mac come in a 64-bit version?
>> >>
>> >> Instead of editing /bin/jwd perhaps we could offer a downloaded script
>> >> on the jwiki page.
>> >> I propose we use this one for now (attached).
>> >> [The text of the jwd "Unix-executable" is appended, in case the
>> >> attachment doesn't work.]
>> >> It just has to be dropped into place (and Spotlight locates jwd
>> >> perfectly well), so perhaps that isn't too scary. Can you see your way
>> >> to modifying your video to do that?
>> >> A neater option is to offer an alternative J icon (a spotted one for
>> >> Snow Leopard?)
>> >> @Brian: You could then say on your video, "if the red J doesn't work,
>> >> try the spotty one?"
>> >> If this is an attractive option, then I'll produce a special Snow
>> >> Leopard icon and this could be included in the j602 download.
>> >>
>> >> Ian
>> >>
>> >> =================
>> >> #!/bin/sh
>> >> # problems - see J bin/install.htm
>> >> cd "`dirname "$0"`/.."
>> >> java -d32 -Xss8000000 -Xdock:name=J -Xdock:icon=bin/icons/jred.icns
>> >> -jar bin/j.jar "$@"
>> >> # The tag: -d32 -is necessary to make J work on the Mac under Snow
>> >> Leopard (10.6 or later)
>> >> =================
>> >>
>> >>
>> >> On Sat, Dec 4, 2010 at 3:32 PM, Brian Schott <[email protected]>
>> >> wrote:
>> >> > Ian et al,
>> >> >
>> >> > I am having the problem addressed by Ian's fine contribution at
>> >> > http://www.jsoftware.com/jwiki/System/Installation/Mac/MacSnowLeopardInstallBug
>> >> > .
>> >> >
>> >> > And when I go there, I see the inserted warning that there is a new
>> >> > fix. Reading those instructions has worked for me but I must say that
>> >> > that is a very user unfriendly fix requiring the editing of a buried
>> >> > text file.
>> >> >
>> >> > That's unfortunate because for example the screencast I made of
>> >> > installing j602 on a Mac will no longer work without the user going
>> >> > through such a fix. It looks like a new screencast is required. But
>> >> > then a new one will be required for j701 installation.
>> >> >
>> >> > http://www.youtube.com/watch?v=fDS-SPtwLS4
>> >> >
>> >> > Otoh, I have attempted to add an annotation to the original screencast
>> >> > suggesting a fix. The link below permits others to edit the
>> >> > annotations also, I believe. [What an incredible option, if it works!!
>> >> > please offer feedback to me especially if the annotation does not show
>> >> > up (btw, it has not shown up live yet for me, but I hope the problem
>> >> > is just a delay in processing at the youtube server).]
>> >> >
>> >> > http://www.youtube.com/watch?v=fDS-SPtwLS4&layer_token=88dca620e88c5dde
>> >> > ----------------------------------------------------------------------
>> >> > For information about J forums see http://www.jsoftware.com/forums.htm
>> >> >
>> >
>> >> ----------------------------------------------------------------------
>> >> For information about J forums see http://www.jsoftware.com/forums.htm
>> >
>> >
>> > --
>> > regards,
>> > ====================================================
>> > GPG key 1024D/4434BAB3 2008-08-24
>> > gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
>> > ----------------------------------------------------------------------
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm