Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
On Ubuntu, I have fish installed, and have it set as my default shell using chsh -s /usr/bin/fish.
I would like to open a bash shell. Entering bash creates a new fish session. How can I open bash without ending my login session?
If you're typing bash and ending up in a fish shell it almost certainly means you have put exec fish in your ~/.bashrc script. Which is a commonly used technique to make fish your "default" shell without the risk that chsh -s /usr/bin/fish entails. Just remove that line from your .bashrc now that you no longer need it.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am using Terminal on MacOS. My main concern is that I’m commonly seeing command lines starting with the ‘$’ sign.
My command lines begins with a ‘%’ sign. Does this matter? If so, what is the reason?
The reason is that bash is no longer the default shell in macos. The default shell is now zsh which has certain advantages, such as floating-point operators.
You may set the Terminal default shell back to bash if needed. It's path is simply /bin/bash
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I have vim and mintty installed with cygwin.
Have some aliases in bash profile, they work in terminal.
Then I call :!bash from vim, I have the same mintty terminal, but have to source .bash_profile again.
My original intent was to call command :!chrome %
In order to save some overhead, the default shell used by Vim to invoke external commands (i.e. via :! {cmd}) is a non-interactive one; it doesn't read the usual initialization files.
If you want to use shell aliases, you can reconfigure Vim to start an interactive one (adding the i flag):
:set shellcmdflag=-ic
Aliases are typically defined in .bashrc; however, you mention .bash_profile. That one is only read for login shells, so either move the alias definitions, or start an (even slower) login shell by supplying the l flag in addition to i.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
If some frequently used commands in Unix shell are given short forms, it reduces programmer's effort.
example :
How can I use e instead of "emacs -nw".
You can create command aliases. Open the ~/.bashrc file and add this line:
alias e='emacs -nw'
Then re-load it to apply changes:
source ~/.bashrc
In your .bashrc in your home directory add
alias e='emacs -nw'
to the end of the file. Either source the .bashrc file or open a new terminal to see the effects.
If you aren't already aware of aliases, skip them and move straight to shell functions:
e () {
emacs -nw "$#"
}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Say I create a cron job that runs a Zsh or Bash script as /path/to/shell_script.sh
Would such a shell be a non-interactive non-login shell? If so, what shell init files would be executed (for Bash & Zsh)?
zsh sources .zshenv (source).
bash sources $BASH_ENV if set. (source)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
We use as the default shell: Bash on our servers but some of us like zsh more, so we searching for a way, to set ZSH automatically.
chsh to zsh i not an option.
How about
ssh -t remote_user#remote_host zsh
?
Depends on how 'automatically' do you want it.
If you want that just ssh -t remote_user#remote_host should give you zsh prompt, then you should think on the lines of bash functions probably. but IMO, that would be a really bad way to do it.