-
Understanding Swift Types (More on Types: Swift Documentation)
-
Emoticons and How to work with them (More on Strings: Swift Documentation)
When using ZSH as your default shell there is a chance you’ll set specific options on your .zshrc script to make work easier.
You can read about ZSH options and what they do here for more information on what you can do with zsh options.
Problem is, when doing ZSH scripts you can’t depend on the user having specific options. So you must be careful that you are not assuming the script works on any environment since your script may be depending on your specific options. Also the user may set an option that breaks your script.
To avoid this, you should set there following code at the start of all your zsh scripts:
The read command can be a headache when you are porting your scripts from a shell to another.
Let's see the way it works with bash (the default shell for macOS before Catalina):
read -p "Do you wish to continue? (Y/n)"
[[ $REPLY == "y" ]] && echo "You must use Capital Y if you wish to continue"
[[ $REPLY != "Y" ]] && exit