Skip to main content
added 296 characters in body
Source Link
mmmmmm
  • 31k
  • 18
  • 94
  • 158

Your examples do not show that the shell you are running is zsh.

What they show is the default shell is zsh and the ps one shows you ran bash from inside a zsh shell.

A way to see the current shell is echo $0 from https://askubuntu.com/questions/590899/how-do-i-check-which-shell-i-am-using However this only works in some cases. It does work if you call bash from zsh as you are doing. It does not work on the non POSIX shells I use e.g. fish and xonsh

$SHELL is the default shell and not what you are running (and that is zsh as you want) login man pages e.g. http://man.openbsd.org/login.1 (or run man login on macOS) $SHELL is set by the login program . However as noted in the man page shells might do other things and also you can (not by default) run a non login shell in Terminal.app and I think that might also have $SHELL set

For the process the $$ is the pid of what the command line sees e.g. trhe shell that runs the bash line you gave.

To see this

  1. Start bash e.g. bash
  2. In the bash shell now run ps -p $$ you get something like
    ~ bash
     bash-5.0$ ps -p $$
      PID TTY           TIME CMD
    28098 ttys000    0:00.01 bash
    bash-5.0$ exit

~ is my zsh prompt. bash is bash 5.0 installled via macports

Your examples do not show that the shell you are running is zsh.

What they show is the default shell is zsh and the ps one shows you ran bash from inside a zsh shell.

$SHELL is the default shell and not what you are running (and that is zsh as you want) login man pages e.g. http://man.openbsd.org/login.1 (or run man login on macOS) $SHELL is set by the login program . However as noted in the man page shells might do other things and also you can (not by default) run a non login shell in Terminal.app and I think that might also have $SHELL set

For the process the $$ is the pid of what the command line sees e.g. trhe shell that runs the bash line you gave.

To see this

  1. Start bash e.g. bash
  2. In the bash shell now run ps -p $$ you get something like
    ~ bash
     bash-5.0$ ps -p $$
      PID TTY           TIME CMD
    28098 ttys000    0:00.01 bash
    bash-5.0$ exit

~ is my zsh prompt. bash is bash 5.0 installled via macports

Your examples do not show that the shell you are running is zsh.

What they show is the default shell is zsh and the ps one shows you ran bash from inside a zsh shell.

A way to see the current shell is echo $0 from https://askubuntu.com/questions/590899/how-do-i-check-which-shell-i-am-using However this only works in some cases. It does work if you call bash from zsh as you are doing. It does not work on the non POSIX shells I use e.g. fish and xonsh

$SHELL is the default shell and not what you are running (and that is zsh as you want) login man pages e.g. http://man.openbsd.org/login.1 (or run man login on macOS) $SHELL is set by the login program . However as noted in the man page shells might do other things and also you can (not by default) run a non login shell in Terminal.app and I think that might also have $SHELL set

For the process the $$ is the pid of what the command line sees e.g. trhe shell that runs the bash line you gave.

To see this

  1. Start bash e.g. bash
  2. In the bash shell now run ps -p $$ you get something like
    ~ bash
     bash-5.0$ ps -p $$
      PID TTY           TIME CMD
    28098 ttys000    0:00.01 bash
    bash-5.0$ exit

~ is my zsh prompt. bash is bash 5.0 installled via macports

added 296 characters in body
Source Link
mmmmmm
  • 31k
  • 18
  • 94
  • 158

Your examples do not show that the shell you are running is zsh.

What they show is the default shell is zsh and the ps one shows you ran bash from inside a zsh shell.

$SHELL is the default shell and not what you are running (and that is zsh as you want) login man pages e.g. http://man.openbsd.org/login.1 (or run man login on macOS) $SHELL is set by the login program . However as noted in the man page shells might do other things and also you can (not by default) run a non login shell in Terminal.app and I think that might also have $SHELL set

For the process the $$ is the pid of what the command line sees e.g. trhe shell that runs the bash line you gave.

To see this

  1. Start bash e.g. bash
  2. In the bash shell now run ps -p $$ you get something like
    ~ bash
     bash-5.0$ ps -p $$
      PID TTY           TIME CMD
    28098 ttys000    0:00.01 bash
    bash-5.0$ exit

~ is my zsh prompt. bash is bash 5.0 installled via macports

Your examples do not show that the shell you are running is zsh.

What they show is the default shell is zsh and the ps one shows you ran bash from inside a zsh shell.

$SHELL is the default shell and not what you are running (and that is zsh as you want)

For the process the $$ is the pid of what the command line sees e.g. trhe shell that runs the bash line you gave.

To see this

  1. Start bash e.g. bash
  2. In the bash shell now run ps -p $$ you get something like
    ~ bash
     bash-5.0$ ps -p $$
      PID TTY           TIME CMD
    28098 ttys000    0:00.01 bash
    bash-5.0$ exit

~ is my zsh prompt. bash is bash 5.0 installled via macports

Your examples do not show that the shell you are running is zsh.

What they show is the default shell is zsh and the ps one shows you ran bash from inside a zsh shell.

$SHELL is the default shell and not what you are running (and that is zsh as you want) login man pages e.g. http://man.openbsd.org/login.1 (or run man login on macOS) $SHELL is set by the login program . However as noted in the man page shells might do other things and also you can (not by default) run a non login shell in Terminal.app and I think that might also have $SHELL set

For the process the $$ is the pid of what the command line sees e.g. trhe shell that runs the bash line you gave.

To see this

  1. Start bash e.g. bash
  2. In the bash shell now run ps -p $$ you get something like
    ~ bash
     bash-5.0$ ps -p $$
      PID TTY           TIME CMD
    28098 ttys000    0:00.01 bash
    bash-5.0$ exit

~ is my zsh prompt. bash is bash 5.0 installled via macports

Source Link
mmmmmm
  • 31k
  • 18
  • 94
  • 158

Your examples do not show that the shell you are running is zsh.

What they show is the default shell is zsh and the ps one shows you ran bash from inside a zsh shell.

$SHELL is the default shell and not what you are running (and that is zsh as you want)

For the process the $$ is the pid of what the command line sees e.g. trhe shell that runs the bash line you gave.

To see this

  1. Start bash e.g. bash
  2. In the bash shell now run ps -p $$ you get something like
    ~ bash
     bash-5.0$ ps -p $$
      PID TTY           TIME CMD
    28098 ttys000    0:00.01 bash
    bash-5.0$ exit

~ is my zsh prompt. bash is bash 5.0 installled via macports