Sunday, May 11, 2014

Mac: Can't access terminal with bash

Thanks to Apple Malverick update, I had to redo a lot of configurations to get my software to work again. During that update, I somehow locked myself out of my bash shell so I couldn't use the terminal. I keep getting "Permission denied" when it tries to open bash.

Thankfully, I have zsh shell installed. I have iTerm2 so I changed the profile to start with the zsh shell.
  1. Open iTerm2
  2. Click "Profiles" from the menu
  3. Click "Open Profiles"
  4. Click "Edit Profiles"
  5. On the "General" tab, select a profile
  6. Click "Other Actions" at the bottom right
  7. Select "Duplicate Profile"
  8. On the left side, in the command section, select "Command"
  9. Enter "/bin/zsh --login" or wherever you think your zsh might be located
  10. Click "Profiles" from the menu again
  11. Select your new profile
That will allow you access to the terminal. Now you can try to change the permission or ownership on your bash file.

Unfortunately, that didn't work for me so I had to reverted back to an old bash version located. I did a lot of fiddling around, but I think these two steps did the trick.

  1. Change your shell file
    1. sudo vim /etc/shells (it doesn't have to be vim, use whatever text editor you like)
    2. Change where your bash program is located
  2. Change your default shell
    1. chsh
    2. Fill out everything.
      1. For the longest time, I only filled out my name and got the "chsh: /bin/bash: non-standard shell"
 That should do the trick I hope.

Thursday, May 8, 2014

Resolving Library not loaded for readline on Mac

After upgrading my mac, I was having this error whenever I start my terminal:
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.2.dylib
Referenced from: /usr/local/bin/psql
Reason: image not found
After some Googling, a lot of answers were, reinstall readline, by
brew install readline
I couldn't do that because I don't have access to my terminal. So I decided to manually install it. After some more frustration and googling, I found the readline that works.