Skip to content

Instantly share code, notes, and snippets.

View jmeubank's full-sized avatar

John E. jmeubank

View GitHub Profile
@mikeslattery
mikeslattery / x-platform.sh
Last active January 26, 2026 15:51
Cross Platform Bash Snippet for Linux, WSL 1, Cygwin, Msys, and GitBash.
#!/bin/bash
# shebang added only to appease shellcheck
# Cross-platform for bash.
# Worry less about when writting a script that must run on Windows, Linux, and Mac.
# Meant to be used with "source" command in scripts.
# Compatiblity with MacOS's old bash
if [ -n "$ZSH_VERSION" ]; then
# After a rerun as Zsh, simulate bash