Friday, 14 January 2022

TIL: Suppressing Apple's "nagware" about ZSH

Whilst helping a colleague get to grips with shells on his Mac, including seeing what shells are out there: -

cat /etc/shells

# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.
/bin/bash
/bin/csh
/bin/dash
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

and switching between them: -

chsh -s /bin/dash hayd

Changing shell for hayd.

Password for hayd: 

chsh -s /bin/bash hayd

Changing shell for hayd.

Password for hayd: 

we also discussed the "nagware" that  includes in macOS to get us to switch away from the oh-so-ancient Bash 3.2: -

bash --version

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin21)
Copyright (C) 2007 Free Software Foundation, Inc.

namely: -

Last login: Fri Jan 14 17:06:42 on ttys001
java version "1.8.0_311"
Java(TM) SE Runtime Environment (build 1.8.0_311-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.311-b11, mixed mode)
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.

Using this: -

How to hide the ‘default interactive shell is now zsh’ message in Terminal on macOS

as source, I coached him to add: -

export BASH_SILENCE_DEPRECATION_WARNING=1

to ~/.bash_profile 

and now we just see this: -

Last login: Fri Jan 14 17:14:33 on ttys001
java version "1.8.0_311"
Java(TM) SE Runtime Environment (build 1.8.0_311-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.311-b11, mixed mode)

No comments:

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...