3 ms·
OT but the first command I type on a new install of MacOS is $ chsh -s /bin/bash because I have 20 years worth of bash scripts that I've carefully tailored
by dreamcompiler 4y ago
OT but the first command I type on a new install of MacOS is
$ chsh -s /bin/bash
because I have 20 years worth of bash scripts that I've carefully tailored to work on bash in MacOS and Linux and I don't have time to rewrite them all just because Apple decided they don't like GPLv3.
- msbarnett 4y agoBefore they changed the default the first command I had to type on a new install was $ chsh -s /bin/zsh You can’t please everybody.
- e12e 4y agoI recommend first installing a recent bash from macports, update /etc/shells first; then change to /opt/local/bin/bash. Unless you enjoy using an ancient bash.
- Phurist 4y agoWtf, macports ? Please do your self a favor and install Nix package manager.
- e12e 4y agoI did look at nix, but was less than enthusiastic about how complex[1] the software is. If I could, I would probably prefer gnu guix - but AFAIK it is unlikely to ever support running on macos - and is similarly complex (build daemon needed to run in background). I'm also sad that pkgsrc seems to be abandoned wrt binary builds for macos - I could at least not find correct gpg keys for verifying the archives listed at: https://pkgsrc.joyent.com/install-on-macos/ https://pkgsrc.joyent.com/install-on-macos/ Perhaps it's workable as a build-from-source package manager. For now, it seems that macports have most of what I need - with less complexity than nix, and a better handling of upgrades than brew. Does appear that brew moves faster, eg: https://trac.macports.org/ticket/65922 https://trac.macports.org/ticket/65922 (i briefly tried a local build, but ran into dependency problems with libvterm that I didn't manage to resolve - there's a 0.3 [2] tarball, but the build system for neovim wasn't happy and kept finding 0.1.4 after it was uninstalled in favour of 0.3). [1] https://nixos.org/manual/nix/stable/installation/installing-binary.html#macos-installation https://nixos.org/manual/nix/stable/installation/installing-... [2] https://www.leonerd.org.uk/code/libvterm/ https://www.leonerd.org.uk/code/libvterm/
- kotlin2 4y agoYou could still use those scripts with a shebang, no?
- joombaga 4y agoIt's still bash 3 though, right? You're okay with that? I tend to install the newest from brew.
- yjftsjthsd-h 4y ago? Don't you just make the scripts start with `#!/user/bin/env bash`? Or do you mean aliases/functions?
- revscat 4y agoI I do not do this because I have 20 years of zsh scripts. Also, I like zsh better.
- thakoppno 4y agodoesn’t mac show a bash deprecation warning or something else that’s obnoxious when you do that? export BASH_SILENCE_DEPRECATION_WARNING=1
- wyclif 4y agoIn zsh, it should look like this when you launch bash in the shell: ~ $ bash The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh`. For more details, please visit https://support.apple.com/kb/HT208050 https://support.apple.com/kb/HT208050. bash-3.2$ ~ So it's easy to switch between bash and zsh. It's quite rare for me to be in situation where I need to do something that only plays nice with bash, though.
- jmmv 4y agoTo each their own, but know that you are stuck with a really old version of bash if you do that, and it has some “interesting” bugs in it. See something I wrote a little while ago on this topic: https://jmmv.dev/2019/11/macos-bash-baggage.html https://jmmv.dev/2019/11/macos-bash-baggage.html
- computerfriend 4y agoYou can still run Bash from Zsh. Your terminal shell is irrelevant.
- greyw 4y agoEspecially annoying if you have scripts that are meant to be sourced by the shell i.e. the shebang doesn't help you.
- CorrectHorseBat 4y agoI that case you could try to emulate bash before sourcing the script
- sneak 4y agoI haven’t personally found any system bash scripts that don’t work on system zsh, but I don’t use many bash features because the macOS system bash was so old and outdated. YMMV of course.
- vdchuyen 4y ago
- commandersaki 4y agoI recommend not changing the default shell, but rather having Terminal.app (or whatever) start the shell of your choice (in my case: /opt/local/bin/bash). You can't trust that the files in /opt/local or /usr/local will always be there, whereas the ones bundled by macos will.
- WhyNotHugo 4y agoThat changes your default shell, bash scripts (which should have the sheband `#!/usr/bin/env bash` will still get executed by bash normally.