The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to make VI editor show colors in Unix whatisthis Shell Programming and Scripting 7 05-26-2006 10:57 PM
what command can show calendar in unix system? kennethchow UNIX for Dummies Questions & Answers 2 12-20-2005 01:17 AM
Problems with "show device" command Lestat HP-UX 3 03-21-2005 07:54 PM
ksh: how to make [up arrow] recall command history BG_JrAdmin UNIX for Dummies Questions & Answers 3 03-15-2005 06:32 AM
How would I make a find command NOT show the path of a file? LordJezo Shell Programming and Scripting 1 10-01-2004 03:01 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-21-2008
Registered User
 

Join Date: Nov 2007
Posts: 15
Is there any way to make up arrow show last command in CSh?

Hi, I've been looking for a way to make the up arrow show the last command in csh, like how it does in bash/ksh. I've been googling and just can't find anything.....anybody have any ideas? thanks!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-22-2008
drl's Avatar
drl drl is offline
Registered User
 

Join Date: Apr 2007
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 474
Hi.

Quote:
The command-line editor (+)
Command-line input can be edited using key sequences much like those
used in GNU Emacs or vi(1). The editor is active only when the edit
shell variable is set, which it is by default in interactive shells.
The bindkey builtin can display and change key bindings. Emacs-style
key bindings are used by default (unless the shell was compiled other-
wise; see the version shell variable), but bindkey can change the key
bindings to vi-style bindings en masse.

The shell always binds the arrow keys (as defined in the TERMCAP envi-
ronment variable) to

down down-history
up up-history
left backward-char
right forward-char

unless doing so would alter another single-character binding.

-- excerpt form man tcsh
I looked quickly through man csh on Solaris 10 and found nothing relating to this, so if you are required to use the real csh (not tcsh), you may be out of luck for this feature. However, tcsh was installed on Solaris 10.

Best wishes ... cheers, drl
Reply With Quote
  #3 (permalink)  
Old 03-22-2008
Registered User
 

Join Date: Nov 2007
Posts: 15
OK, I've changed my default login shell to tcsh, but it seems that the bindkey builtin is not installed. "bindkey" and "man bindkey" both do nothing, although the same excerpt in your post is also in my tcsh manpage. Strange....Is bindkey a redhat-only feature or something? Also, when I enter "$VERSION" to check the shell version, it says it's an undefined variable. So at this point I don't even know what tcsh version I have. Any ideas?
Reply With Quote
  #4 (permalink)  
Old 03-22-2008
Registered User
 

Join Date: Nov 2007
Posts: 15
Hmmm......I think I forgot to log off and log in again after I changed my login shell......hence all the errors. Silly me. So problem solved for now. Thanks!
Reply With Quote
  #5 (permalink)  
Old 03-22-2008
drl's Avatar
drl drl is offline
Registered User
 

Join Date: Apr 2007
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 474
Hi.

Here's how I usually find the tcsh version; this is from Solaris 10:
Code:
$ tcsh -c 'echo "tcsh $tcsh"'
tcsh 6.12.00
Using the usual GNU/Linux idiom:
Code:
tcsh --version
produces more information.

These also work on FreeBSD and GNU/Linux.

Were you in tcsh when you tried bindkey? ... cheers, drl
Reply With Quote
  #6 (permalink)  
Old 03-22-2008
drl's Avatar
drl drl is offline
Registered User
 

Join Date: Apr 2007
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 474
Hi.
Quote:
Originally Posted by sayeo View Post
Hmmm......I think I forgot to log off and log in again after I changed my login shell......hence all the errors. Silly me. So problem solved for now. Thanks!
OK, good ... cheers, drl
Reply With Quote
Google UNIX.COM
Reply

Tags
linux, solaris

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:38 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0