Is there any way to make up arrow show last command in CSh?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Is there any way to make up arrow show last command in CSh?
# 1  
Old 03-22-2008
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!
# 2  
Old 03-22-2008
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
# 3  
Old 03-22-2008
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?
# 4  
Old 03-22-2008
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!
# 5  
Old 03-22-2008
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
# 6  
Old 03-22-2008
Hi.
Quote:
Originally Posted by sayeo
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Show complete command on command line when we use 'ps'

Hi, When I query using ps -ef, the complete command is not displayed and is truncated. Can you please tell me a method to resolve this ? I have tried the below. ps -ef | cat ps -ef | grep imp >/tmp/t1.txt /usr/ucb/ps -auxw pargs <pid> /usr/ucb/ps -aefyl | grep imp Thanks (11 Replies)
Discussion started by: mk1216
11 Replies

2. Shell Programming and Scripting

How to make diff show differences one line at a time and not group them?

Is there a way to tell diff to show differences one line at a time and not to group them? For example, I have two files: file1: line 1 line 2 line 3 diff line 4 diff line 5 diff line 6 line 7 file2: line 1 line 2 line 3 diff. line 4 diff. line 5 diff. line 6 line 7 (13 Replies)
Discussion started by: mmr11408
13 Replies

3. Shell Programming and Scripting

up down arrow key and edit on command line.

I am using ksh, By doing change in .profile as set -o vi my updown and history does not work. Also I can not edit command line on prompt using vi command. My TERM is vt100. What is wrong here ? Thanks. :cool: (3 Replies)
Discussion started by: ekb
3 Replies

4. Shell Programming and Scripting

is there command to show the fs on a directory?

On Solaris, is there a command which can show the file system of a specific directory? In a script, i need to figure out whether a directory or its parent directory is mounted as "NFS". Is there a easy way to figure it out? (3 Replies)
Discussion started by: sleepy_11
3 Replies

5. Shell Programming and Scripting

how to make your bash script run on a machine with csh and bash

hi, i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
Discussion started by: npatwardhan
3 Replies

6. UNIX and Linux Applications

command scrolling using arrow keys

hi, can anyone tell me how to enable arrow keys to scroll thru the commands on command prompt. I am using C shell ( I know, in k shell, set -o vi would enable vi command history, but set -o doesnte exist in c shell) (4 Replies)
Discussion started by: hemangi13
4 Replies

7. Shell Programming and Scripting

how to make VI editor show colors in Unix

Hi, I saw some people's vi editor show different colors on the text according the nature of text when using it. It would be nice if I can see diffrerent colors with my vi editor. Do anybody know how to set it up? I use PowerTermPro program to access unix machine. I tried to use vim editor but... (7 Replies)
Discussion started by: whatisthis
7 Replies

8. Shell Programming and Scripting

How to make a cshell (csh) script interactive

Experts, I tried to make my cshell script interactive by asking the user for password and trying to read the input using the "read" command. I have been unsuccessful so far. Do you have any idea ? Thanks Jim (2 Replies)
Discussion started by: jimmynath
2 Replies

9. UNIX for Dummies Questions & Answers

ksh: how to make [up arrow] recall command history

I want to get my up arrow key to recall my previous commands in Korn shell. Anyone help please? thanks a bunch! BG (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

10. Shell Programming and Scripting

How would I make a find command NOT show the path of a file?

When I do find . -name "*.txt" -size +0 -exec ls {} \; I get something like ./lpi_stdout.txt ./lpi_stderr.txt What would I need to do or pipe it into to strip off those first two characters so I just get lpi_stdout.txt lpi_stderr.txt ? Thanks for the help! (1 Reply)
Discussion started by: LordJezo
1 Replies
Login or Register to Ask a Question