Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm connecting to a Solaris box from Mac OS X. Whenever I have connected to linux boxes in the past it has been much easier to navigate around. How do I fix these configuration issues on Solaris?

  1. Have to use control+h instead of backspace key
  2. When in man the escape key does not quit the man page - how do I exit?
  3. I didn't see a .bash_profile or .profile in the home directory, how do I set up things like alias ll="ls -al" on the remote machine?
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

A Solaris machine has ksh as the default shell, I believe. Ksh doesn't have the sophisticated interactive feature you may be used to if you've used bash or zsh before. If you want a comfortable environment, install zsh or at least bash on the Solaris machine. If bash or zsh is already installed by the system administrator, use chsh to switch to it. If you install it yourself, you won't be allowed to use chsh, but instead you can switch shells inside your .profile (make this the last thing):

case $- in *i*)
  ## This is an interactive shell, try to switch over to a better shell
  if whence zsh >/dev/null 2>/dev/null; then exec zsh -i; fi
  if whence bash >/dev/null 2>/dev/null; then exec bash -i; fi
  ;;
esac

If you decide to stick with ksh, its configuration file is ~/.kshrc, that's where you would define aliases. (Note that aliases are for each shell instance, not for a session, so they don't belong in ~/.profile).

The Backspace key should work out of the box if everybody left things well alone. Unfortunately, many OSes ship with settings that make double sure everything works as long as you're using the same OS everywhere, but break the automation that would otherwise make things work across remote logins. I don't know which of Solaris or OSX is the culprit. If you don't feel like investigating, you can tell the Solaris shell that the “DEL character” deletes to the left with this command in your ~/.profile (this will do the wrong thing if you log in from a machine where BackSpace sends ^H).

stty erase '^?'

The Escape key doesn't normally quit any text mode application. The usual man page viewer is less, and its quit command is bound to q.

share|improve this answer
    
you're right, it is ksh by default. i prefer bash over zsh at this point. i put my aliases in ~/.bash_profile but they are not working even though bash is loaded at the end of .profile. thanks for taking the time to write such a nice answer. –  cwd Oct 21 '11 at 22:44
1  
@cwd Bash aliases go into ~/.bashrc. ~/.bash_profile is only loaded if bash is your login shell. Here ksh is your login shell. –  Gilles Oct 22 '11 at 0:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.