Open itinance opened 9 years ago
See #536
@mathiasbynens you might want to add this to the readme :)
Thanks a lot!
By the way, these both lines will fix these issues, maybe they could be part of the brew.sh script?
sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'
chsh -s /usr/local/bin/bash
^ +1
^ +1 thanks @itinance
^ +1 thanks @itinance
+1... and +1 thanks @itinance!
+1... and +1 thanks @itinance!
Thanks @itinance
+1 thanks @itinance
+1 thanks @itinance
Here is a article on updating Bash on Mac OS X.
^ +1 thanks @itinance
@itinance Here’s a slightly more robust version:
if ! grep '/usr/local/bin/bash' /etc/shells; then
echo '/usr/local/bin/bash' | sudo tee -a /etc/shells;
chsh -s /usr/local/bin/bash;
fi;
Thanks @itinance and @mathiasbynens
it's not work on subl
it is still using /bin/bash so I can see
error
"usr/local/share/bash-completion/bash_completion: line 1812: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
/usr/local/share/bash-completion/bash_completion: line 1949: complete: -D: invalid option
complete: usage: complete [-abcdefgjksuv] [-pr] [-o option] [-A action] [-G globpat] [-W wordlist] [-P prefix] [-S suffix] [-X filterpat] [-F function] [-C command] [name ...]
"
but i want to change new bash how to do ? i already try to use
if ! grep '/usr/local/bin/bash' /etc/shells; then
echo '/usr/local/bin/bash' | sudo tee -a /etc/shells;
chsh -s /usr/local/bin/bash;
fi;
on root and mine
@sd9972 did you open a new shell to test out the results of your chsh
operation? Also, I would not chsh
for root, since /usr/local/bin/bash
can potentially be deleted quite easily.
@jeffbyrnes Thanks for help. :) http://imgur.com/EpFP792 this is my chsh status http://imgur.com/9cshkGN it is my sublime
@sd9972 can’t really tell what that chsh
status means… in any case, a few things to check:
brew install bash
to install a newer version of bash?/usr/local/bin/bash
is in your /etc/shells
?echo $SHELL
?echo $0
?Please just copy & paste the output of your shell here, no need to take screenshots, you can use fenced code blocks to make it render more clearly.
sd9972 at Dongs-MBPr in ~
$ brew install bash
Warning: bash-4.3.42 already installed
sd9972 at Dongs-MBPr in ~
$ cat /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.
/usr/local/bin/bash
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
sd9972 at Dongs-MBPr in ~
$ echo $SHELL
/usr/local/bin/bash
sd9972 at Dongs-MBPr in ~
$ echo $0
-bash
Well, that all looks good. Perhaps try running chsh -s /usr/local/bin/bash
again, just for your user?
sd9972 at Dongs-MBPr in ~
$ chsh -s /usr/local/bin/bash
Changing shell for sd9972.
Password for sd9972:
chsh: no changes made
and Sublime text
@sd9972 damn. Yeah, really not sure what‘s going on there. Do you have any other shell stuff loaded up? bash-it or something similar?
i don't use bash-it or something about bash shell w/o this !!!
@sd9972 I’m at a loss as to what’s missing from your setup, and why the version of bash installed via brew isn’t the bash your shell is using. Sorry I can’t be of more help!
@mathiasbynens just did a fresh install and noticed this issue as well, wondering if it's worth adding your solution in somewhere to automate this fix?
Also getting this error:
chsh: Operation was denied because the current credentials do not have the appropriate privileges. Operation was denied because the current credentials do not have the appropriate privileges.
chsh: no changes made
I tried running as sudo
as well and the user is an admin, any ideas please?
I also tried: http://superuser.com/questions/442849/why-do-i-see-operation-was-denied-because-the-current-credentials-do-not-have-t and have /bin/bash
set as my login shell.
With sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'
I get sudo: pam_authenticate: unknown user
.
Then I ran into an issue where I couldn't open Terminal/iTerm, but a computer restart fixed this.
Following @jeffbyrnes commands I get;
༼ つ ◕_◕ ༽つ⚡ brew install bash
Warning: bash-4.3.42 already installed
owensi at Simons-MacBook-Pro.local in ~
༼ つ ◕_◕ ༽つ⚡ cat /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/bash
/usr/local/bin/bash
/usr/local/bin/bash
owensi at Simons-MacBook-Pro.local in ~
༼ つ ◕_◕ ༽つ⚡ echo $0
-bash
༼ つ ◕_◕ ༽つ⚡ chsh -s /usr/local/bin/bash
Changing shell for owensi.
Password for owensi:
chsh: Operation was denied because the current credentials do not have the appropriate privileges. Operation was denied because the current credentials do not have the appropriate privileges.
chsh: no changes made
@s10wen two things:
chsh
for itselfchsh
for root
, that could have unpredictable results (in fact, try not to mess with root
at all)You’ll want to remove the duplicate entries for /usr/local/bin/bash
from your /etc/shells
.
I’m curious, is your user an admin user? And are you on El Capitan?
Thanks for the reply I'm just travelling atm but I'll have a look later today. I'm on El Capitan. Something that might be a factor is that this is a work machine, I have a local admin 'simonowen' then also a work admin 'owensi' but afaik they both have full admin rights.
On 28 Jan 2016, at 14:10, Jeff Byrnes notifications@github.com wrote:
@s10wen two things:
your user should definitely have permissions to chsh for itself I’d strongly discourage doing chsh for root, that could have unpredictable results (in fact, try not to mess with root at all) You’ll want to remove the duplicate entries for /usr/local/bin/bash from your /etc/shells.
I’m curious, is your user an admin user? And are you on El Capitan?
— Reply to this email directly or view it on GitHub.
As long as they’re both admins, you should be able to chsh
, but perhaps your work did something to lock it down.
@jeffbyrnes I enabled a 'mobile' user in the system preferences and I'm sorted now :) looks like it was a permissions / user issue. Thanks for your help, cleaned up the duplicate entries as well.
@s10wen 's mention of 'mobile' user led me to a solution that worked for me: I'm on an Active Directory domain which is controlled by Centrify. I had to follow these steps to set my shell in the /etc/centrifydc/centrifydc.conf
configuration file as described here.
I was having this issue as well, and, fixed it with the code in @itinance 's comment. Here's what happened with mine:
Since I already had a homebrew dev environment setup, I chose not to use the brew.sh script. Instead, I just installed the newer Bash manually, then issued the $ chsh -s /usr/local/bin/bash
command, which seemed to succeed. The problem: I had overlooked this crucial comment in brew.sh. Oops! Oh, the things we can miss when we lack enough sleep!
So... if you're having this issue, maybe you missed this, too? You have to manually add the new Bash path to /etc/shells
for this to work correctly.
I've installed this dotfiles-repo on a newly installed Yosemite Machine. I also ran brew.sh after installing homebrew. Everything works as expected, but not in the terminal.
After reboot each terminal starts with lots of errors:
Also, when i want to use bash completion, something like this happens:
I typed "mv Dropb" and pressed the Tab-key then. The other characters "-bash: $(prev..." occur then and restricts me to use the bash completion as it was possible before installing these dotfiles.
which part of the dotfiles should i change (or delete) to fix these issues?