Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Oct 2016 11:52:00 -0400
From:      Anton Yuzhaninov <citrin+bsd@citrin.ru>
To:        freebsd-questions@freebsd.org
Subject:   Re: csh history search
Message-ID:  <99ed60e6-2132-943e-262b-1a237a6f578f@citrin.ru>
In-Reply-To: <580E2B4F.4000003@gmail.com>
References:  <580E2B4F.4000003@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/24/16 11:39, Ernie Luzar wrote:
> Lets say that a while back I issued this command
> ping -c 4 hometown.jones.domain.com
>
> Now I would like to retrieve that domain name from the history list.
>
> On the command line I enter  !?jon
> The complete ping command is retrieved and automatically executed.
>
> I don't want the found command automatically executed, I just want the
> found command inserted to the command line being visible so I can
> manually modify it before choosing to execute it.

If you have

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

in ~/.cshrc (there by default in FreeBSD)

your can type
*jon*
and then using up/down arrows list all history entries matched by *jon* 
and edit lime before executing.

See
man tcsh
/history-search-backward
for more info.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99ed60e6-2132-943e-262b-1a237a6f578f>