How to find the current shell that you’re working in ?
echo $SHELLcould work, but not reliable if you’re using bash within zsh/fish.
ps -p $$- fish does not support this.
ps- Gives a list of running shells, and reliably the second last line gives the correct shell.
1) Using inside default fish:
> ps PID TTY TIME CMD 7603 pts/17 00:00:00 fish 8347 pts/17 00:00:00 ps
2) Using inside bash which is running inside fish:
> ps PID TTY TIME CMD 7603 pts/17 00:00:00 fish 8521 pts/17 00:00:00 bash 8708 pts/17 00:00:00 ps
3) Using inside bash inside zsh inside fish:
> ps PID TTY TIME CMD 21845 pts/0 00:00:00 fish 22193 pts/0 00:00:00 zsh 22727 pts/0 00:00:00 bash 22728 pts/0 00:00:00 ps
Share onTwitter Facebook Google+ LinkedIn
Leave a Comment
sudo apt-get install conky-all ...
Fix a wallpaper. Here’s mine: ...