We help IT Professionals succeed at work.

Solaris 5.8 - How to add command prompt features

Mark Ebden
Mark Ebden asked
on

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
Comment
Watch Question

CERTIFIED EXPERT

Commented:
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.

   

   
CERTIFIED EXPERT

Commented:
lso bash as login shell kan do it
there is no simple way for Solaris' default csh

Commented:
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

Author

Commented:

How do I know if I'm using ksh or tcsh?
CERTIFIED EXPERT

Commented:
current shell:  echo $SHELL
login shell: grep "$USER" /etc/passwd|awk -F: '{print $NF}'

Author

Commented:

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

Am I using tcsh?
CERTIFIED EXPERT

Commented:
    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


   

     

     

     
Commented:
Hi !

At the $ prompt say:

   ksh -o vi

and whenever you want to get the prev. commands you can simply press ESC key and then you can move back or forward using the K and J keys on the key board.


R. K.
Hey,
  Just change UR shell to bash or after U login execute bash. Bash is the most coolest shell.

PROMPT>bash

Girix

Author

Commented:

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
CERTIFIED EXPERT

Commented:
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

Author

Commented:

Wish I could have accepted the comment instead.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.