Skip to content

Instantly share code, notes, and snippets.

View lathindu1's full-sized avatar
🇱🇰
Making wold more better

Lathindu Pramuditha lathindu1

🇱🇰
Making wold more better
View GitHub Profile
@lathindu1
lathindu1 / sphp.sh
Last active September 17, 2021 17:00 — forked from rhukster/sphp.sh
Easy Brew PHP version switching [Apple Silicon]
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
osx_patch_version=${osx_patch_version:-0}
osx_version=$((${osx_major_version} * 10000 + ${osx_minor_version} * 100 + ${osx_patch_version}))
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')