0

I know there is, for example, hostnamectl command on linux and system_profiler SPSoftwareDataType command on macOS to know the operating system version, but I'm looking for a command that works for both operating systems. Does it exist?

2

1 Answer 1

1

I use uname -s with tr inside Makefile to determine the system and decide whether to use .so od .dylib.

On macOS

> uname -s | tr '[:upper:]' '[:lower:]'
darwin

On Linux

> uname -s | tr '[:upper:]' '[:lower:]'
linux
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.