https://github.com/acook/osinfo.bash
Displays the OS and Distro
https://github.com/acook/osinfo.bash
Last synced: 8 months ago
JSON representation
Displays the OS and Distro
- Host: GitHub
- URL: https://github.com/acook/osinfo.bash
- Owner: acook
- Created: 2012-07-13T17:16:31.000Z (almost 14 years ago)
- Default Branch: main
- Last Pushed: 2025-08-31T18:58:37.000Z (10 months ago)
- Last Synced: 2025-08-31T20:45:29.829Z (10 months ago)
- Language: Shell
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
OSinfo.bash
===========
Dumps the platform and distro.
Anthony M. Cook (2012-2021)
Usage
-----
I use this in my startup scripts to determine which configuration blocks should run on Linux or Mac systems.
Designed to be unixy, use filters with this to get the information you want.
Example of usage:
```bash
$ osinfo.bash
linux
ubuntu
$ platform=$(osinfo.bash | head -1)
$ distro=$(osinfo.bash | tail -1)
```
Possible future enhancements
----------------------------
If you think any of these are particularly useful, let me know, or even better send me code.
* Detect PureDarwin/OpenDarwin
* Detect OSX version (eg Lion, Leopard, Mountain Lion)
* Detect Ubuntu version (eg Raring Ringtail, Lucid Lynx, Hardy Heron)