What is the "official" name of the operating system under MacOS neXt?

Where does perl get it?

I need it so that I can write perl and shell scripts that can be tested on a Mac and 
then run under Solaris. I solicit comments on the most reliable way to keep things 
working at least until next week.

>From Terminal or a BBEdit window:
echo $OSTYPE
darwin

>From within a cron job: 
echo $OSTYPE >> $HOME/bin/cronlog
darwin6.0
uname >> $HOME/bin/cronlog
Darwin

>From perl executed from terminal:
print $^0 --> darwin

>From perl executed from cron:
print $^0 --> darwin

>From a BBEdit worksheet or from terminal:
perl -e 'print `uname`;'
Darwin

Using bash:
if [ $(uname) = Darwin ] ; then
works. Note the capital D. It fails with darwin.
-- 

Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.

Reply via email to