Output of “${OSTYPE:6}” on old releases of Mac OS Xodd behavior of pgrep in bash scriptDownloading old...
Did the CIA blow up a Siberian pipeline in 1982?
What does "play with your toy’s toys" mean?
How to remove this component from PCB
Array initialization optimization
Is this proposal by U.S. presidential candidate Pete Buttigieg to change the composition of the Supreme Court constitutional?
What's currently blocking the construction of the wall between Mexico and the US?
What size of powerbank will I need to power a phone and DSLR for 2 weeks?
What exactly is the 'online' in OLAP and OLTP?
How is hair tissue mineral analysis performed?
Has there been any indication at all that further negotiation between the UK and EU is possible?
How do I professionally let my manager know I'll quit over smoking in the office?
Hot coffee brewing solutions for deep woods camping
What is the legal status of travelling with methadone in your carry-on?
How do I turn off a repeating trade?
Understanding the reasoning of the woman who agreed with King Solomon to "cut the baby in half"
How does a blind passenger not die, if driver becomes unconscious
Trainee keeps missing deadlines for independent learning
Drawing people along with x and y axis
Is a single radon-daughter atom in air a solid?
Unusual mail headers, evidence of an attempted attack. Have I been pwned?
Is it illegal to withhold someone's passport and green card in California?
Silly doubt about tidal effects and Einstein Field Equations
Why is prior to creation called holy?
Count All Possible Unique Combinations of Letters in a Word
Output of “${OSTYPE:6}” on old releases of Mac OS X
odd behavior of pgrep in bash scriptDownloading old Safari point releases (Ex: 8.0.4)How can I explain to my friend that running a “hackintosh” is a violation of the law?OS X 10.10 (Yosemite) Custom Shutdown Screen/BehaviorIs 10.10.5 more stable than 10.10.0?iMac fails to complete boot from main drive with flashing black screenMac terminal strange output on returnTerminal login hangsHow do I install macOS 10.11 El Capitan on a Mac mini (Late 2012)Mac mini periodically dumps all connected file-sharing users
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I'm writing a shell script that I want to be theoretically compatible with very old versions of Mac OS X (I say "theoretically", because I lack any super-old machines to actually test with). The script uses the output of ${OSTYPE:6}
to determine which release of Mac OS X it's running on.
On a machine running 10.13 High Sierra, echo ${OSTYPE:6}
returns 17
. On a machine running 10.10 Yosemite, it returns 14
. Logic thus suggests that the command would output "15" on 10.11 and "16" on 10.12.
(This is useful, because it allows me to include lines like if [[ ${OSTYPE:6} -ge 14 ]]; then DoThing; fi
to run DoThing
on any system running Yosemite and newer.)
Does this pattern hold for old releases as well? For example, would the command return "4" on the original 10.0?
I ask because, well, it would be odd to start at 4, so I'm worried that somewhere in history, the number was incremented by a point update.
macos
add a comment |
I'm writing a shell script that I want to be theoretically compatible with very old versions of Mac OS X (I say "theoretically", because I lack any super-old machines to actually test with). The script uses the output of ${OSTYPE:6}
to determine which release of Mac OS X it's running on.
On a machine running 10.13 High Sierra, echo ${OSTYPE:6}
returns 17
. On a machine running 10.10 Yosemite, it returns 14
. Logic thus suggests that the command would output "15" on 10.11 and "16" on 10.12.
(This is useful, because it allows me to include lines like if [[ ${OSTYPE:6} -ge 14 ]]; then DoThing; fi
to run DoThing
on any system running Yosemite and newer.)
Does this pattern hold for old releases as well? For example, would the command return "4" on the original 10.0?
I ask because, well, it would be odd to start at 4, so I'm worried that somewhere in history, the number was incremented by a point update.
macos
For some older versions, it returns a dotted number pair. On OS X 10.6.8 I get "10.0", and on OS X 10.3.9 I get "7.0". Unfortunately, that meansbash
can't do numeric comparisons on it in these versions.
– Gordon Davisson
6 hours ago
add a comment |
I'm writing a shell script that I want to be theoretically compatible with very old versions of Mac OS X (I say "theoretically", because I lack any super-old machines to actually test with). The script uses the output of ${OSTYPE:6}
to determine which release of Mac OS X it's running on.
On a machine running 10.13 High Sierra, echo ${OSTYPE:6}
returns 17
. On a machine running 10.10 Yosemite, it returns 14
. Logic thus suggests that the command would output "15" on 10.11 and "16" on 10.12.
(This is useful, because it allows me to include lines like if [[ ${OSTYPE:6} -ge 14 ]]; then DoThing; fi
to run DoThing
on any system running Yosemite and newer.)
Does this pattern hold for old releases as well? For example, would the command return "4" on the original 10.0?
I ask because, well, it would be odd to start at 4, so I'm worried that somewhere in history, the number was incremented by a point update.
macos
I'm writing a shell script that I want to be theoretically compatible with very old versions of Mac OS X (I say "theoretically", because I lack any super-old machines to actually test with). The script uses the output of ${OSTYPE:6}
to determine which release of Mac OS X it's running on.
On a machine running 10.13 High Sierra, echo ${OSTYPE:6}
returns 17
. On a machine running 10.10 Yosemite, it returns 14
. Logic thus suggests that the command would output "15" on 10.11 and "16" on 10.12.
(This is useful, because it allows me to include lines like if [[ ${OSTYPE:6} -ge 14 ]]; then DoThing; fi
to run DoThing
on any system running Yosemite and newer.)
Does this pattern hold for old releases as well? For example, would the command return "4" on the original 10.0?
I ask because, well, it would be odd to start at 4, so I'm worried that somewhere in history, the number was incremented by a point update.
macos
macos
edited 8 hours ago
Wowfunhappy
asked 9 hours ago
WowfunhappyWowfunhappy
1,42811231
1,42811231
For some older versions, it returns a dotted number pair. On OS X 10.6.8 I get "10.0", and on OS X 10.3.9 I get "7.0". Unfortunately, that meansbash
can't do numeric comparisons on it in these versions.
– Gordon Davisson
6 hours ago
add a comment |
For some older versions, it returns a dotted number pair. On OS X 10.6.8 I get "10.0", and on OS X 10.3.9 I get "7.0". Unfortunately, that meansbash
can't do numeric comparisons on it in these versions.
– Gordon Davisson
6 hours ago
For some older versions, it returns a dotted number pair. On OS X 10.6.8 I get "10.0", and on OS X 10.3.9 I get "7.0". Unfortunately, that means
bash
can't do numeric comparisons on it in these versions.– Gordon Davisson
6 hours ago
For some older versions, it returns a dotted number pair. On OS X 10.6.8 I get "10.0", and on OS X 10.3.9 I get "7.0". Unfortunately, that means
bash
can't do numeric comparisons on it in these versions.– Gordon Davisson
6 hours ago
add a comment |
3 Answers
3
active
oldest
votes
That sounds very much like it's returning the Darwin version.
Your theory works well from 10.15 Mojave [18] back to 10.2 Jaguar [6] but fails before that, as Darwin was 1.x.x at that point.
There's a full list at Wikipedia - macOS
1
$OSTYPE is a z shell parameter which is derived fromuname -r
.
– fd0
8 hours ago
1
@fd0 - that may as well be Martian ;-)
– Tetsujin
8 hours ago
add a comment |
Apple stores version information in Core Foundation and here is the source code showing how they build to each version.
- https://opensource.apple.com/source/DarwinTools/DarwinTools-1/sw_vers.c.auto.html
I’d use sw_vers
to get your version information if you’re scripting rather than use uname
or other variables.
Wouldsw_vers
work in a shell script?
– Wowfunhappy
8 hours ago
It’s in the path of all the shipping shells on macOS / OS X / Darwin, so yes @Wowfunhappy it will work well.
– bmike♦
8 hours ago
Thanks. I remember why I didn't use this now—because it doesn't output an integer likeOSTYPE:6
, I can't use a simple -ge / -le checks to isolate "this version and everything newer/older"
– Wowfunhappy
8 hours ago
@Wowfunhappy Aren’t the build numbers monotonically increasing and sortable as strings? I think there’s an entire python library / module to handle this iirc - it’s pyfacts - github.com/timsutton/python-macadmin-tools
– bmike♦
8 hours ago
Ah, Finlay Doobie, who fixed a bug in OS X that escaped Apple's software engineers for over a year - wired.com/2002/03/apple-ousts-coder-for-being-young
– fd0
7 hours ago
add a comment |
I don't have a 10.0 machine to test on, but on a 10.3 machine, echo ${OSTYPE:6}
returns a blank line; on 10.6, it returns 10.0
.
(Incidentally, your shell script would need to explicitly invoke bash
. The default shell on very old versions of OSX is tcsh
, which doesn't understand the ${OSTYPE:6}
syntax.)
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
That sounds very much like it's returning the Darwin version.
Your theory works well from 10.15 Mojave [18] back to 10.2 Jaguar [6] but fails before that, as Darwin was 1.x.x at that point.
There's a full list at Wikipedia - macOS
1
$OSTYPE is a z shell parameter which is derived fromuname -r
.
– fd0
8 hours ago
1
@fd0 - that may as well be Martian ;-)
– Tetsujin
8 hours ago
add a comment |
That sounds very much like it's returning the Darwin version.
Your theory works well from 10.15 Mojave [18] back to 10.2 Jaguar [6] but fails before that, as Darwin was 1.x.x at that point.
There's a full list at Wikipedia - macOS
1
$OSTYPE is a z shell parameter which is derived fromuname -r
.
– fd0
8 hours ago
1
@fd0 - that may as well be Martian ;-)
– Tetsujin
8 hours ago
add a comment |
That sounds very much like it's returning the Darwin version.
Your theory works well from 10.15 Mojave [18] back to 10.2 Jaguar [6] but fails before that, as Darwin was 1.x.x at that point.
There's a full list at Wikipedia - macOS
That sounds very much like it's returning the Darwin version.
Your theory works well from 10.15 Mojave [18] back to 10.2 Jaguar [6] but fails before that, as Darwin was 1.x.x at that point.
There's a full list at Wikipedia - macOS
answered 9 hours ago
TetsujinTetsujin
63.4k15107205
63.4k15107205
1
$OSTYPE is a z shell parameter which is derived fromuname -r
.
– fd0
8 hours ago
1
@fd0 - that may as well be Martian ;-)
– Tetsujin
8 hours ago
add a comment |
1
$OSTYPE is a z shell parameter which is derived fromuname -r
.
– fd0
8 hours ago
1
@fd0 - that may as well be Martian ;-)
– Tetsujin
8 hours ago
1
1
$OSTYPE is a z shell parameter which is derived from
uname -r
.– fd0
8 hours ago
$OSTYPE is a z shell parameter which is derived from
uname -r
.– fd0
8 hours ago
1
1
@fd0 - that may as well be Martian ;-)
– Tetsujin
8 hours ago
@fd0 - that may as well be Martian ;-)
– Tetsujin
8 hours ago
add a comment |
Apple stores version information in Core Foundation and here is the source code showing how they build to each version.
- https://opensource.apple.com/source/DarwinTools/DarwinTools-1/sw_vers.c.auto.html
I’d use sw_vers
to get your version information if you’re scripting rather than use uname
or other variables.
Wouldsw_vers
work in a shell script?
– Wowfunhappy
8 hours ago
It’s in the path of all the shipping shells on macOS / OS X / Darwin, so yes @Wowfunhappy it will work well.
– bmike♦
8 hours ago
Thanks. I remember why I didn't use this now—because it doesn't output an integer likeOSTYPE:6
, I can't use a simple -ge / -le checks to isolate "this version and everything newer/older"
– Wowfunhappy
8 hours ago
@Wowfunhappy Aren’t the build numbers monotonically increasing and sortable as strings? I think there’s an entire python library / module to handle this iirc - it’s pyfacts - github.com/timsutton/python-macadmin-tools
– bmike♦
8 hours ago
Ah, Finlay Doobie, who fixed a bug in OS X that escaped Apple's software engineers for over a year - wired.com/2002/03/apple-ousts-coder-for-being-young
– fd0
7 hours ago
add a comment |
Apple stores version information in Core Foundation and here is the source code showing how they build to each version.
- https://opensource.apple.com/source/DarwinTools/DarwinTools-1/sw_vers.c.auto.html
I’d use sw_vers
to get your version information if you’re scripting rather than use uname
or other variables.
Wouldsw_vers
work in a shell script?
– Wowfunhappy
8 hours ago
It’s in the path of all the shipping shells on macOS / OS X / Darwin, so yes @Wowfunhappy it will work well.
– bmike♦
8 hours ago
Thanks. I remember why I didn't use this now—because it doesn't output an integer likeOSTYPE:6
, I can't use a simple -ge / -le checks to isolate "this version and everything newer/older"
– Wowfunhappy
8 hours ago
@Wowfunhappy Aren’t the build numbers monotonically increasing and sortable as strings? I think there’s an entire python library / module to handle this iirc - it’s pyfacts - github.com/timsutton/python-macadmin-tools
– bmike♦
8 hours ago
Ah, Finlay Doobie, who fixed a bug in OS X that escaped Apple's software engineers for over a year - wired.com/2002/03/apple-ousts-coder-for-being-young
– fd0
7 hours ago
add a comment |
Apple stores version information in Core Foundation and here is the source code showing how they build to each version.
- https://opensource.apple.com/source/DarwinTools/DarwinTools-1/sw_vers.c.auto.html
I’d use sw_vers
to get your version information if you’re scripting rather than use uname
or other variables.
Apple stores version information in Core Foundation and here is the source code showing how they build to each version.
- https://opensource.apple.com/source/DarwinTools/DarwinTools-1/sw_vers.c.auto.html
I’d use sw_vers
to get your version information if you’re scripting rather than use uname
or other variables.
answered 8 hours ago
bmike♦bmike
164k46300643
164k46300643
Wouldsw_vers
work in a shell script?
– Wowfunhappy
8 hours ago
It’s in the path of all the shipping shells on macOS / OS X / Darwin, so yes @Wowfunhappy it will work well.
– bmike♦
8 hours ago
Thanks. I remember why I didn't use this now—because it doesn't output an integer likeOSTYPE:6
, I can't use a simple -ge / -le checks to isolate "this version and everything newer/older"
– Wowfunhappy
8 hours ago
@Wowfunhappy Aren’t the build numbers monotonically increasing and sortable as strings? I think there’s an entire python library / module to handle this iirc - it’s pyfacts - github.com/timsutton/python-macadmin-tools
– bmike♦
8 hours ago
Ah, Finlay Doobie, who fixed a bug in OS X that escaped Apple's software engineers for over a year - wired.com/2002/03/apple-ousts-coder-for-being-young
– fd0
7 hours ago
add a comment |
Wouldsw_vers
work in a shell script?
– Wowfunhappy
8 hours ago
It’s in the path of all the shipping shells on macOS / OS X / Darwin, so yes @Wowfunhappy it will work well.
– bmike♦
8 hours ago
Thanks. I remember why I didn't use this now—because it doesn't output an integer likeOSTYPE:6
, I can't use a simple -ge / -le checks to isolate "this version and everything newer/older"
– Wowfunhappy
8 hours ago
@Wowfunhappy Aren’t the build numbers monotonically increasing and sortable as strings? I think there’s an entire python library / module to handle this iirc - it’s pyfacts - github.com/timsutton/python-macadmin-tools
– bmike♦
8 hours ago
Ah, Finlay Doobie, who fixed a bug in OS X that escaped Apple's software engineers for over a year - wired.com/2002/03/apple-ousts-coder-for-being-young
– fd0
7 hours ago
Would
sw_vers
work in a shell script?– Wowfunhappy
8 hours ago
Would
sw_vers
work in a shell script?– Wowfunhappy
8 hours ago
It’s in the path of all the shipping shells on macOS / OS X / Darwin, so yes @Wowfunhappy it will work well.
– bmike♦
8 hours ago
It’s in the path of all the shipping shells on macOS / OS X / Darwin, so yes @Wowfunhappy it will work well.
– bmike♦
8 hours ago
Thanks. I remember why I didn't use this now—because it doesn't output an integer like
OSTYPE:6
, I can't use a simple -ge / -le checks to isolate "this version and everything newer/older"– Wowfunhappy
8 hours ago
Thanks. I remember why I didn't use this now—because it doesn't output an integer like
OSTYPE:6
, I can't use a simple -ge / -le checks to isolate "this version and everything newer/older"– Wowfunhappy
8 hours ago
@Wowfunhappy Aren’t the build numbers monotonically increasing and sortable as strings? I think there’s an entire python library / module to handle this iirc - it’s pyfacts - github.com/timsutton/python-macadmin-tools
– bmike♦
8 hours ago
@Wowfunhappy Aren’t the build numbers monotonically increasing and sortable as strings? I think there’s an entire python library / module to handle this iirc - it’s pyfacts - github.com/timsutton/python-macadmin-tools
– bmike♦
8 hours ago
Ah, Finlay Doobie, who fixed a bug in OS X that escaped Apple's software engineers for over a year - wired.com/2002/03/apple-ousts-coder-for-being-young
– fd0
7 hours ago
Ah, Finlay Doobie, who fixed a bug in OS X that escaped Apple's software engineers for over a year - wired.com/2002/03/apple-ousts-coder-for-being-young
– fd0
7 hours ago
add a comment |
I don't have a 10.0 machine to test on, but on a 10.3 machine, echo ${OSTYPE:6}
returns a blank line; on 10.6, it returns 10.0
.
(Incidentally, your shell script would need to explicitly invoke bash
. The default shell on very old versions of OSX is tcsh
, which doesn't understand the ${OSTYPE:6}
syntax.)
add a comment |
I don't have a 10.0 machine to test on, but on a 10.3 machine, echo ${OSTYPE:6}
returns a blank line; on 10.6, it returns 10.0
.
(Incidentally, your shell script would need to explicitly invoke bash
. The default shell on very old versions of OSX is tcsh
, which doesn't understand the ${OSTYPE:6}
syntax.)
add a comment |
I don't have a 10.0 machine to test on, but on a 10.3 machine, echo ${OSTYPE:6}
returns a blank line; on 10.6, it returns 10.0
.
(Incidentally, your shell script would need to explicitly invoke bash
. The default shell on very old versions of OSX is tcsh
, which doesn't understand the ${OSTYPE:6}
syntax.)
I don't have a 10.0 machine to test on, but on a 10.3 machine, echo ${OSTYPE:6}
returns a blank line; on 10.6, it returns 10.0
.
(Incidentally, your shell script would need to explicitly invoke bash
. The default shell on very old versions of OSX is tcsh
, which doesn't understand the ${OSTYPE:6}
syntax.)
answered 1 min ago
MarkMark
1397
1397
add a comment |
add a comment |
For some older versions, it returns a dotted number pair. On OS X 10.6.8 I get "10.0", and on OS X 10.3.9 I get "7.0". Unfortunately, that means
bash
can't do numeric comparisons on it in these versions.– Gordon Davisson
6 hours ago