1

In SunOS 5.10, I could not get bash autocompletion (when TAB is pressed) to work. Arrow keys do not go through history either. Also, even though PS1 is set to \u@\h:\w\$, on command prompt it shows u@h:w$. Any ideas how can I fix it?

This is the result of pkginfo -l SUNWbash command:

   PKGINST:  SUNWbash
   NAME:  GNU Bourne-Again shell (bash)
   CATEGORY:  system
   ARCH:  i386
   VERSION:  11.10.0,REV=2005.01.08.01.09
   BASEDIR:  /
   VENDOR:  Sun Microsystems, Inc.
   DESC:  GNU Bourne-Again shell (bash) version 3.0
   PSTAMP:  sfw10-patch-x20070430084427
   INSTDATE:  Aug 28 2012 15:01
   HOTLINE:  Please contact your local service provider
   STATUS:  completely installed
   FILES:        3 installed pathnames
               2 shared pathnames
               2 directories
               1 executables
            1194 blocks used (approx)

BTW I am connecting through ssh from Max OSX.

And I can't even learn the version of bash:bash --version command creates a subshell.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
gonda
  • 19
  • 1
  • 3

3 Answers3

3

In Solaris 10 plain-old Bourne Shell was still the default shell, not Bash. This changed in 2011 with the release of Solaris 11.

For Solaris 10 and supposing your user is 'john', then do as follows.

  1. Change to root: su - root
  2. Execute : usermod -s /usr/bin/bash john.

You'll need to logout from 'john' completely and login again.

peterh
  • 924
  • 1
  • 8
  • 17
  • Unfortunately, I don't have root access. I tried to run `/usr/bin/bash`, but it is still the same. It looks like `tcsh` has some kind of auto-completition. – gonda Oct 06 '16 at 15:05
0

To restore autocompletion and history navigation with arrow keys (without changing your interactive shell like peterh suggested although that is totally alright), try the following command:

$ set -o emacs

If that does not work, try :

$ export EDITOR=emacs

Copy whatever command works for you in you ~/.profile and this should be set automatically whenever you open a terminal.

Valentin B.
  • 775
  • 5
  • 18
  • I tried it too, still does not work :( – gonda Oct 06 '16 at 15:09
  • Well, seems plain sh terminal only supports vi style in-line edition :(. Here is some additional information: http://unix.stackexchange.com/questions/85390/what-is-meant-by-a-shell-is-in-vi-mode-or-emacs-mode – Valentin B. Oct 06 '16 at 15:17
  • And here is a cheat sheet to using vi style in line edition mode : http://www.catonmat.net/blog/bash-vi-editing-mode-cheat-sheet/ – Valentin B. Oct 06 '16 at 15:25
0

This fixed my Solaris 10:

tcsh
set autolist

TAB should work from there on in your terminal.

Lefty G Balogh
  • 226
  • 4
  • 8