cursor command history like Linux?

cursor command history like Linux?

Post by David Efflan » Wed, 13 Oct 1999 04:00:00



I figured out how to get the inconsistant backspace key working
consistantly in xterm and rxvt using stty in .cshrc.

But I am just curious if anyone knows how to get the cursor keys to work
with command history or command line editing like Linux does (like up for
previous command)?

I guess I got in the habit of using it, and in FreeBSD (or my Solaris ISP)
hitting the cursor keys results in the control codes for the keys, which
are sometimes hard to delete (so I ^C to a fresh line).

--

http://www.de-srv.com  http://cgi-help.virtualave.net/
http://thunder.prohosting.com/~cv-elgin/

 
 
 

cursor command history like Linux?

Post by Rolf Marvin B?e Lindgre » Wed, 13 Oct 1999 04:00:00


[David Efflandt]

| But I am just curious if anyone knows how to get the cursor keys to work
| with command history or command line editing like Linux does (like up for
| previous command)?

this has nothing to do with Linux and everything to do with the shell
you are using.  zsh, tcsh and bash all support this.  

don't give root any other shell than sh.

--
Rolf Lindgren                                        http://www.uio.no/~roffe/


 
 
 

cursor command history like Linux?

Post by Desmond Coughla » Wed, 13 Oct 1999 04:00:00



> I figured out how to get the inconsistant backspace key working
> consistantly in xterm and rxvt using stty in .cshrc.

> But I am just curious if anyone knows how to get the cursor keys to work
> with command history or command line editing like Linux does (like up for
> previous command)?

I had this problem too.  Edit the file etc/master.passwd and after the
entry for the user's home directory, enter:

/usr/local/bin/bash

... or whatever the path is on your machine.  Then logout and login again.

Leave root with sh, as if you have problems booting, you're sure that
sh is usable, being on /.  I much prefer bash, so on the rare
occasions when I use root, I run:

exec bash

... knowing that sh is there, in case the shit hits the fan.

D.

--
Desmond Coughlan                |Restez Zen ... UNIX peut le faire

http://212.198.64.228/               [under construction]

 
 
 

cursor command history like Linux?

Post by freebsd b » Wed, 13 Oct 1999 04:00:00



Quote:>I had this problem too.  Edit the file etc/master.passwd and after the
>entry for the user's home directory, enter:

might use chsh instead (change shell)
 
 
 

cursor command history like Linux?

Post by Stephen Montgomery-Smit » Wed, 13 Oct 1999 04:00:00



Quote:

> [David Efflandt]

> | But I am just curious if anyone knows how to get the cursor keys to work
> | with command history or command line editing like Linux does (like up for
> | previous command)?

> this has nothing to do with Linux and everything to do with the shell
> you are using.  zsh, tcsh and bash all support this.

> don't give root any other shell than sh.

Actually, I made a statically linked version of tcsh, and put it in /bin,
and now have root using /bin/tcsh.   (Hope that isn't bad.)

--




University of Missouri-Columbia
Columbia, MO 65211
USA

Phone (573) 882 4540
Fax   (573) 882 1869

http://math.missouri.edu/~stephen

 
 
 

cursor command history like Linux?

Post by Rolf Marvin B?e Lindgre » Wed, 13 Oct 1999 04:00:00


[Rolf Marvin B?e Lindgren]

| don't give root any other shell than sh.

[Stephen Montgomery-Smith]

| Actually, I made a statically linked version of tcsh, and put it in /bin,
| and now have root using /bin/tcsh.   (Hope that isn't bad.)

no, that's a good idea.  I don't know if it will survive upgrades tho.

--
Rolf Lindgren                                        http://www.uio.no/~roffe/

 
 
 

cursor command history like Linux?

Post by Ricardo Anguian » Wed, 13 Oct 1999 04:00:00


This is getting off the thread topic but no one has mentioned the
"toor" user.  Log in as toor and you get bash.

-Ricardo



> >I had this problem too.  Edit the file etc/master.passwd and after the
> >entry for the user's home directory, enter:

> might use chsh instead (change shell)

 
 
 

cursor command history like Linux?

Post by Michael Maxwel » Wed, 13 Oct 1999 04:00:00



> I had this problem too.  Edit the file etc/master.passwd and after the
> entry for the user's home directory, enter:

> /usr/local/bin/bash

You could also do "chsh <username>".  Much safer.  And other shells
besides bash (Bloated Again SHell) have command history keys: tcsh,
zsh, and my personal favorite: ksh.  See www.kornshell.com for more
info on ksh93 or install pdksh.  I don't know how compatible pdksh is
with AT&T ksh, though.

--
Michael Maxwell  <drwho at xnet.com> | Fight Email Abuse! www.cauce.org
  UNIX Geek, Programmer, Systems Administrator, Professional Target
                               <-- This space intentionally left blank.

 
 
 

cursor command history like Linux?

Post by Hai Nguye » Thu, 14 Oct 1999 04:00:00


Hello there,
 I think from your sh shell you can enter the command "set -E" and it should
work.

Regards, hai nguyen.


> I figured out how to get the inconsistant backspace key working
> consistantly in xterm and rxvt using stty in .cshrc.

> But I am just curious if anyone knows how to get the cursor keys to work
> with command history or command line editing like Linux does (like up for
> previous command)?

> I guess I got in the habit of using it, and in FreeBSD (or my Solaris ISP)
> hitting the cursor keys results in the control codes for the keys, which
> are sometimes hard to delete (so I ^C to a fresh line).

> --

> http://www.de-srv.com  http://cgi-help.virtualave.net/
> http://thunder.prohosting.com/~cv-elgin/

 
 
 

cursor command history like Linux?

Post by Hai Nguye » Thu, 14 Oct 1999 04:00:00


Hello there,
 I think from your sh shell you can enter the command "set -E" and it should
work.

Regards, hai nguyen.


> I figured out how to get the inconsistant backspace key working
> consistantly in xterm and rxvt using stty in .cshrc.

> But I am just curious if anyone knows how to get the cursor keys to work
> with command history or command line editing like Linux does (like up for
> previous command)?

> I guess I got in the habit of using it, and in FreeBSD (or my Solaris ISP)
> hitting the cursor keys results in the control codes for the keys, which
> are sometimes hard to delete (so I ^C to a fresh line).

> --

> http://www.de-srv.com  http://cgi-help.virtualave.net/
> http://thunder.prohosting.com/~cv-elgin/

 
 
 

cursor command history like Linux?

Post by Phea » Fri, 15 Oct 1999 04:00:00


Quote:> > But I am just curious if anyone knows how to get the cursor keys to work
> > with command history or command line editing like Linux does (like up
for
> > previous command)?

Most linux distros ship with bash as the default shell which allows the use
of the up/down cursor keys for command history. I personally like to use
bash for freebsd as well. If you'd like to run it : make ; make install
bash2 from /usr/ports/shells and then chpass each user and change the
default shell from say /bin/sh to /usr/local/bin/bash. ( I recommend against
this for the user 'toor' -- keep him sh.. Some may even recommend you to
stick with sh for 'root' but I like my command history :P )
 
 
 

1. filename completion via tab, command history via cursor keys etc.

Hi,

I can get my hands on a solaris workstation at the office the next two
days. I noticed that the automatic filename completion when pressing the
tab key is not enabled. Also, the cursor keys, insert and delete keys
etc. just print out gibberish.

How can I configure certain keys to do what I want ? Command history is
also something that's lacking. I've been looking on the net to find
something useful but to no avail. It appears to me that these settings
have nothing to do with the shell I'm running (bourne). Couldn't find
anything on this in the bourne shell documentation.

Should I try the man pages for 'bindkey' and/or 'stty' ? When the
machine boots it defaults in CDE and I intend to keep on working in a
GUI environment.

Sorry if this is a newbee question but I have no Solaris experience
whatsoever, just a bit of Linux... In other words, any useful
information (URLs, docs, ...) is also welcome.

Regards,

--
Filip Sneppe

2. Win98 client not obtaining lease from RH9 dhcpd server

3. Date stamping commands in the shell command history file

4. Stupid Programmer Question..

5. ksh: 2 Q's, command completion & command history?

6. ANNOUNCE: SNMP Sniffer v1.0

7. rememeber history of tcshell command line commands after reboot

8. arow key in telnet

9. Solaris "showrev" command look-a-likes?

10. History recall with up/down cursor keys in X - is it possible?

11. how to use cursor to move through history

12. ksh+cmdtool: history function with cursor keys :-(

13. Linux how does one clear out the history command