# Emulating tcsh history-search in bash



## arapaima (Nov 4, 2012)

I'm really comfortable with the way tcsh is able to handle backward and forward searches in command history.
Is there a way of emulate this using the bash shell? I don't like the behavior of ^R.

This is how I use it in tcsh

```
bindkey -k up history-search-backward
bindkey -k down history-search-forward
```


----------



## AlexJ (Nov 5, 2012)

arapaima said:
			
		

> Is there a way of emulate this using the bash shell? I don't like the behavior of ^R.



Drop it

```
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
```

to the bash_profile or the same without bind to the .inputrc in home user's directory.


----------



## arapaima (Nov 5, 2012)

"emulate" in this case should be interpreted as "want same behavior" 
bind  did it. Thanks!


----------



## SirDice (Nov 5, 2012)

Most linux boxes also have tcsh(1), I usually just switch my shell to that


----------



## UNIXgod (Nov 6, 2012)

The Z Shell can emulate csh. Actually it may emulate bash now. Crazy

http://www.acm.uiuc.edu/workshops/zsh/emulation.html


----------

