What's the deal with Deno? We talk with a major contributor to find out. Listen now.

Hot answers tagged

225

First, some important things: Bash isn't going away. If you're already using bash, nothing will change for you. All that changes is that zsh will be the default login shell for new accounts, and even then, you can select bash instead. Scripts are not affected. What changes is the shell for interactive use, i.e. the shell in terminals (and also a few other ...


45

If your friend changed the command that shells are opened with, you can change it back to the default login shell from Terminal's preferences: If the default login shell was changed, you can change it back to /bin/bash by running chsh -s /bin/bash. zsh is included with OS X (in /bin/zsh), but even if your friend installed a newer version of zsh, you don't ...


43

macOS Catalina and later (10.15+) Apple replaced bash with zsh as the default shell. See article. So no need to do anything. You can verify the default shell by typing echo $0 in the terminal. macOS Mojave and earlier (10.14-) See Apple Support page, Use zsh as the default shell on your Mac Surprisingly this doesn't work with the command line tools as ...


35

If your default system shell is bash, your Terminal should start with it. You can check it on General tab under Terminal Preferences. Should look like the following: If bash isn't your default shell, you can change it by typing: chsh -s /bin/bash To configure iTerm2 with zsh you have to open Preferences and change the command on General tab on your ...


26

The final problem is related to zsh. oh-my-zsh is executing bracketed-paste-magic, so I ended up removing it. Because oh-my-szh doesn't have a plugin manager for this. You have to override the file: $ZSH/lib/misc.zsh The overrides will be in this folder $ZSH_CUSTOM. Because I don't have any override I had to create the folder first: mkdir $ZSH_CUSTOM/lib/...


26

Bash Since Bash is typically the default shell you can open up this file in your home directory: $ vim ~/.bash_profile And add your variable to this file: export ENV_VAR=12345 You can do this without even having to edit this file if you like, using the following one-liner: $ echo 'export ENV_VAR=12345' >> ~/.bash_profile And then confirm like so:...


21

Change your shell now and test - no need to wait. chsh -s /bin/zsh All the scripts that depend on bash syntax will still find and call bash. the same bash from Mojave is shipping on Catalina and migrated users keep their old shell. Many blogs have great write-ups on moving preference files - here is one such - https://scriptingosx.com/2019/06/moving-to-...


17

You can squeeze the white spaces into a single white space in ls 's output then use cut. ls -l /usr | tr -s ' ' | cut -d ' ' -f3 but avoid parsing ls output. Here's an alternate solution. stat -f'%Su' /usr/*


16

@bmike has already offered the easiest solution, but I wanted to go back to the GUI instructions not working. I found that Apple’s instructions here can be confusing. Control-Clicking will not do anything unless you first “unlock” the Users & Groups pane, as shown below in the blue box: Once you have it unlocked, be sure you are clicking in the white-...


15

Don’t use sudo directly without some additional switches - your invocation would change root’s shell, not your user account. If your short name is mike (you can check with whoami or who am i sudo -s chsh /bin/zsh mike Or if you know an admin short name and password you could skip the sudo initially chsh -u admin /bin/zsh @ me if you still have issues, ...


15

Your shell has been changed to Zsh, which is the default for new users on Catalina (10.15) and later. To go back to the old shell (BASH), run chsh -s /bin/bash (chsh is a "Change Shell command, the -s flag is "set", and /bin/bash is the location of the BASH shell). Then close and re-open terminal, or log out and log back in, and your shell will be bash again....


13

Whether zsh checks for new mail can be adjusted through the MAILCHECK parameter as described in zshparam(1). It specifies the interval in seconds between checks for new mail, a zero turns off the checks completely. So just put this into your zsh configuration file: # don't check for new mail MAILCHECK=0


13

You can't easily (and shouldn't) change/upgrade /bin/bash. You can install a more recent version of bash through Homebrew though, and use the information from How to use bash as default shell to change your login shell. This will not break any existing bash scripts as these refer to #!/bin/bash in the first line.


11

ls doesn't use tabs, cut doesn't work with a variable number of delimeters between fields. ls -l /usr | awk '{print $3}' will work, or ls -l /usr | awk 'NR > 1 {print $3}' if you want to skip the first line (total 0 in your example).


11

This is an attempt to write a canonical QA for this issue, as per the Meta post: Where is the list of canonical questions stored for Ask Different? I expect it to be periodically edited with the goal of becoming a comprehensive information resource. What should be used in ZSH on a Mac I posted a more narrowly scoped question on Unix & Linux and got some ...


10

It tells you that you have received some mails (for example, because of your configuration of cron). The best way is to read this mail. Type mail: at least one mail should appear. You can read by typing its number ID. You can also directly delete it (or even multiple mails) by typing d 1-1344 (1-1344 being the range of your new mails' IDs). Leave mail with ...


10

Prepend each line of a file with a capital A and write a new file- awk '{print "A"$0}' < FILE > NEWFILE


9

To prepend X to the start of every line of file, writing to newfile, in Terminal: sed 's/^/X/' file > newfile Here I'm using sed, the Unix stream editor, to use a very simple regular expression to substitute the beginning of every line (the ^ symbol) with an X.


8

So apparently some program (probably my MAMP) put an email in /var/mail/ Deleting this message did the trick...


8

Use the keyboard shortcuts Shift + Command + ] and Shift + Command + [ to switch to next and previous tabs respectively. The same are also available under iTerm2 Menu Bar → Window menu. The keyboard shortcuts remain the same irrespective of the shell you are running.


8

The error mentioning ‘type’ refers to the data type of the variable, such as string or array. $PATH is a string, $path is an array. You cannot assign a string, whether by variable or by literal, to a variable typed to contain an array, since the types do not match. As for what the difference between the two variables are: they are meant to represent the same ...


7

If you're joined to an Open Directory sever, or any other directory server, the default shell will have to be specified there. In particular, if you're joined to a Microsoft Active Directory, you can use the Directory Utility to change the default shell, as described here. You can always just add zsh to your bash profile so it gets called on logon as a ...


7

In zsh you need to enable the completion system. Please read through man zshcompsys. To install the completion system enter the command compinstall and follow the directions. Check the fpath variable echo $fpath in my situation I needed to declare the variable in my .zshrc fpath=(/usr/local/share/zsh/5.0.7/functions) This is the location of my zsh ...


7

This answer (to a different question) suggests modifying /private/etc/paths or adding a file to the directory /private/etc/paths/d. I just tried sudo nano /private/etc/paths, added /foo at the end of the file, and opened a new tab in Terminal, and echo $PATH showed /foo as expected, in both bash and zsh shells. Assuming you've installed Maven to /opt/apache-...


7

Turns out the terminal app has its own settings for which shell to use. I had to go to terminal preferences and change the option for Shells open with to Default login shell:


7

Did the shell ( terminal ) change in Catalina? These are two completely different things that have nothing to do with each other, so let's address them separately: Did the terminal change in Catalina? No. There might have been updates (although I don't think so), but there have not been any fundamental changes. Did the shell change in Catalina? ...


6

Do you have a custom PS1 that is overriding the prompt from the theme you have selected? Check you don't have any additional lines in ~/.zshrc beyond the default? Backup your .zshrc Delete all lines beyond export PATH=$PATH:/… Reload your Terminal Do you have any plugins that are messing with things? Check ~/.oh-my-zsh/custom/plugins/ for any additional ...


6

How did you uninstall it? The title bars in the screenshots show that the current command is still zsh, or maybe /bin/zsh. If you changed this setting in Terminal's preferences, change it back to the default login shell: If you changed the default login shell, you can change it back to /bin/bash with chsh -s /bin/bash.


6

The problem was the "iTerm" app's conflicting settings with the shell. To resolve, I've reset "login shell" command in iTerm preference window: iTerm.app -> Preferences -> Profiles -> General -> Command -> Click on "Login shell" Then, I executed chsh to modify it as /bin/zsh. To reproduce the problem (having $SHELL set as /bin/bash/, even though the ...


6

This behavior seems to be caused by zsh’s bracketed paste feature, which is on by default as of version 5.1. I found that if I added unset zle_bracketed_paste to my zshrc then dropping files onto Terminal works correctly with zsh 5.2. (This blog post mentions bracketed-paste-magic, which seems like it could be used to support dropping files without ...


Only top voted, non community-wiki answers of a minimum length are eligible