Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 19ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login Register
w

windows

Recently created Least recently created Recently updated Least recently updated
anthony

anthony / Check OS in bash

Last active 1 month ago bash linux macos shell windows

Handy bash-functions to detect current OS

0 0 1
1 #!/usr/bin/env bash
2
3 isMac() {
4 uname -s | grep -q "Darwin"
5 }
6
7 isLinux() {
8 uname -s | grep -q "Linux"
9 }