5

I've been a linux user for years. Very used to the bash shell, used to linux shell key mappings that come with most mainstream distros. I'm also a happy vim user in linux & love my arrow keys.

Just started a job where 90% of the systems are solaris & the default shell for administrators is ksh. The key mappings, things like autocomplete & history not working they way they should and is driving me insane.

How do I get the following working in solaris:

  • Arrow keys working in the shell, the way they do in bash for say RHEL, ubuntu. This means using arrow keys to scroll through my history or edit my current command line

  • Tab completion working, so that i can complete filename / directory paths with tab, or show me matches if there's more then one.

  • Vim working they way it does in linux, so that when i use the arrow keys i don't get ABCD. I'd like it to make the cursor move.
Nick Kavadias
  • 10,796
  • 7
  • 37
  • 47

6 Answers6

3

I have found opencsw very useful you can install a selection of GNU apps from there and they have a package manager simular to apt-get called pkg-get

www.opencsw.org

Useful packages

  • gsed
  • gawk
  • gdate

gives you the latest gnu versions of these apps so you dont have to have different awk scripts depending on the OS

Paul
  • 593
  • 2
  • 6
3

I also had this problem, when for a little i switched from linux only env to mixed sun solaris and linux env.
I have to say that since then, i love solaris. Once you get use with different tools (give a look at this link http://bhami.com/rosetta.html ) then you'll find how powerful is solaris.
Search on google for "Less known Solaris Features" and you'll find a lot of documentation.
Give a look at all the sun (now oracle) documentation about Solaris administration.

PiL
  • 1,599
  • 8
  • 6
3

Sun published a Linux to Solaris Admin Guide (PDF) that describes the key differences, commands, file structure, monitoring, etc. between the two OSes; it's from 2007, but it's likely still very relevant. There's also a brief Quick Reference Guide at the end.

Alexander
  • 101
  • 1
  • 9
WuckaChucka
  • 375
  • 3
  • 8
  • 23
2

Sun in the later versions of Solaris has ported several of the public domain programs. If installed they are located in /opt/sfw. If not, you can download the Companion CD-ROM and get it off of that. I'm using mostly Solaris x86 here.

sunfreeware.com as one user mentioned is an excellent site to get packages to put your public domain programs on line. I have installed these on several of my previous positions and delighted the administrators.

BTW, I would not change the shell assigned to the 'root' user on Solaris. I've had a few nasty surprises when I did this and had to so some serious system recovery work.

mdpc
  • 11,856
  • 28
  • 53
  • 67
1

www.sunfreeware.com is a great starting point, you can download packages of the same GNU utils you use on linux (even if the latest Solaris has begun shipping some more of them). Cheers G.

golemwashere
  • 734
  • 1
  • 10
  • 22
1

It's almost impossible to answer because 'linux' means nothing when there are so many flavors out there, and they could have just about anything set as defaults in in the various profile / login / shell rc scripts.

First, change the shell, as you've already mentioned, but then you might need to look into 'set'. From your comment about the arrow keys not behaving as you like, try either:

set -o emacs
set -o vi

There's also a chance that you've got the wrong terminal emulation set up, but auto-detection has gotten a lot better over the last year or so.

You can also take a look at your favorite box, and copy over your settings (assuming you've set the same shell). Leave a session logged in when testing or you might have to (s)ftp in to move the changed config file out of the way.

update : per the bash man page, you should take a look at:

   /etc/profile
          The systemwide initialization file, executed for login shells
   ~/.bash_profile
          The personal initialization file, executed for login shells
   ~/.bashrc
          The individual per-interactive-shell startup file
   ~/.bash_logout
          The individual login shell cleanup file, executed when  a  login
          shell exits
   ~/.inputrc
          Individual readline initialization file

It's possible that these might call other files, too.

Joe H.
  • 1,917
  • 12
  • 13