Date: Mon, 24 Oct 2016 14:22:37 -0400 From: Ernie Luzar <luzar722@gmail.com> To: Polytropon <freebsd@edvax.de> Cc: Freebsd Questions <FreeBSD-questions@freebsd.org> Subject: Re: csh history search Message-ID: <580E516D.7060502@gmail.com> In-Reply-To: <20161024192356.051bb38d.freebsd@edvax.de> References: <580E2B4F.4000003@gmail.com> <20161024192356.051bb38d.freebsd@edvax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
Polytropon wrote:
> On Mon, 24 Oct 2016 11:39:59 -0400, Ernie Luzar wrote:
>> Hello List;
>> Reading this section "History substitution" in csh(1) seems to indicate
>> I can pull up a previous command from the history list.
>>
>> 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.
>>
>> I could not find any info in csh(1) about auto exec or how to stop it.
>> Hoping someone who uses this csh function could help me out.
>
> Start by typing the first few characters of the command, e. g.
>
> % ping_
>
> then use the up arrow to browse through all commands starting
> with "ping"; if "ping -c 4 hometown.jones.domain.com" was the
> last ping command executed, it will show up immediately, and
> you can start editing the command (Ctrl+right to word-jump,
> or End Ctrl+W to erase the last word, just as you prefer).
>
> The more "words" (or characters) you have at the beginning
> of the command line, the more "precise" the search results
> will be ("ping" is more "precise" than "p").
>
> For more sophisticated searching, you could write a simple
> wrapper around "history | grep" (including a grep -v to remove
> the search itself from the search result); this topic has been
> discussed on the list, and you can surely find working code
> in the archive.
>
ping_ returns this message ping_: Command not found
% ping_ returns this message %: Too many arguments
What "subject" in the questions archive list should I search on to find
the thread talking about searching the command history list?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?580E516D.7060502>
