Link to home
Start Free TrialLog in
Avatar of Mark Ebden
Mark Ebden

asked on

Solaris 5.8 - How to add command prompt features


Hi,

I want to recall the last line I typed at the command prompt, by pressing the UP cursor.  Right now if I do that, I get the following instead:

         myprompt%  ^[

I am jealous of computers that can use the up cursor, and all these other cool features.

Please be exact and explicit in your reply.  Thank you.

Please be exact.


--Mark
Avatar of yuzh
yuzh

Hi Mark Ebden,

    You can try one of the followings:
   
 1. Change your login shell to tcsh, if you have one installled on your systems. tcsh shell enable you to use the arrow key to repeat the command history.
 2. If you are using ksh, and you don't want to cahnge to tcsh.
    you can put the followings in you .kshrc file (you can create one if you don't have one yet)
    EDITOR=emacs
    set -o emacs

    and put the followings in you .profile

    export ENV=$HOME/.kshrc

    please give it a try.

   

   
lso bash as login shell kan do it
there is no simple way for Solaris' default csh
The nearest you can get to this that I am aware of is:

1. change your shell to ksh but editing your userid line in the /etc/passwd and changing /bin/sh to /bin/ksh
(I do NOT recommend you do this on the root account)

2. go to your home directory and edit your .profile
add set -o vi

3 logout and login again

4 you should be able to access previous command lines by pressing escape to enter edit mode, and using j and k to scroll round command lines

for more info see man ksh
Avatar of Mark Ebden

ASKER


How do I know if I'm using ksh or tcsh?
current shell:  echo $SHELL
login shell: grep "$USER" /etc/passwd|awk -F: '{print $NF}'

Using the first line gave me "/bin/csh", and the second line gave me nothing.

Am I using tcsh?
    You are using csh, NOT tcsh. type in
            which tcsh
to see if you can see the tcsh shell, if not found than ask you system adm if your systems have tcsh installed .  

     If you have tcsh installed, you can change to default login shell to tcsh
(must be root to do it). or type in tcsh at command prompt.

     If you don't have tcsh, you can use ksh instead.  you need to create a .profile and a .kshrc file under your home dir .  You change you default login shell to ksh, or change it from csh to ksh at command prompt:

    type in : cd ~
               ksh
               . ./.profile
               . ./.kshrc

    Then you can work in ksh


   

     

     

     
ASKER CERTIFIED SOLUTION
Avatar of sagirk
sagirk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey,
  Just change UR shell to bash or after U login execute bash. Bash is the most coolest shell.

PROMPT>bash

Girix

Thanks, but I don't want to accept the answer about ksh, I want to accept the comment about tcsh posted the night before.  (See above.)  Is that possible?

I am going to go with tcsh.  Is it okay if I add this line to my .mycshrc and my .user.cshrc:

   tcsh

Is that all right?


Thanks,

Mark
hi Mark Ebden,

    If you cahnge your default login shell to tcsh, all your need to do is to put what ever enviroment setup on you .cshrc file.

   otherwise, you can change your sell at command prompt by type in:
    #tcsh <enter>
     
that's it

Wish I could have accepted the comment instead.