4 ms·
On macOS almost everyone uses the homebrew package manager https://brew.sh https://brew.sh. Installing bash is harder because you have to add the filepath of th
by shpx 8y ago
On macOS almost everyone uses the homebrew package manager https://brew.sh https://brew.sh. Installing bash is harder because you have to add the filepath of the new bash binary to /etc/shells and then set that filepath as your default shell, but
brew install bash
echo /usr/local/bin/bash | sudo tee -a /etc/shells
chsh -s /usr/local/bin/bash
and if you're on macOS and still haven't heard of homebrew, you first need to install it with
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- gnulinux 8y agoThat command makes my eyes twitch. This sort of "download random stuff from internet, then pipe them to ruby/perl/python" madness should end, like right now. I'm assuming you're a reasonable person who knows what that commands does. Can you really not see how people can misuse commands like this to execute arbitrary code on people's computers, even experienced engineers if they carelessly copy-paste code like this. As a rule of thumb, to whoever reading this, please don't trust random strangers online and run their code. You never know. Always download code from trusted sources and check sha hashes. Piping anything else to ruby/perl/python is playing with fire.
- nomel 8y agoAlternatively, follow the homebrew installation instructions: https://docs.brew.sh/Installation https://docs.brew.sh/Installation
- shpx 8y agoThat command curls a ruby file from the Homebrew repository on Github. If that Github repo (or Github) is compromised, then no matter how you installed homebrew, you are going to get hacked the next time you run `brew update`, which by default is run on every `brew install`. For me, the odds of that repo being compromised for long enough are outweighed by the convenience. This has been brought up on HN before and I'm not convinced.
- aaaaaaaaaab 8y agoWould you notice if that URL was “raw.githubusercontent.someotherdomain.com” instead of “raw.githubusercontent.com”? I’m pretty sure at least 50% would merrily copy & paste it in their shell.
- h1d 8y agoYou mean, every developer, not everyone.
- okdana 8y agoYou probably don't need to update /etc/shells unless you really want to. chsh just won't let you switch to a shell that's not listed there without using sudo, which isn't a problem for most (generally single-user) Mac systems. You can also change your shell from the Users & Groups system preferences (in the advanced settings).