From owner-freebsd-questions@freebsd.org Mon Oct 24 18:52:21 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1235C1FABF for ; Mon, 24 Oct 2016 18:52:21 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4AB4DCB for ; Mon, 24 Oct 2016 18:52:21 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-117-205.dynamic.qsc.de [92.195.117.205]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id D57D03CE7A; Mon, 24 Oct 2016 20:52:12 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id u9OIqBfd002810; Mon, 24 Oct 2016 20:52:11 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Mon, 24 Oct 2016 20:52:11 +0200 From: Polytropon To: Ernie Luzar Cc: Freebsd Questions Subject: Re: csh history search Message-Id: <20161024205211.34a33b02.freebsd@edvax.de> In-Reply-To: <580E516D.7060502@gmail.com> References: <580E2B4F.4000003@gmail.com> <20161024192356.051bb38d.freebsd@edvax.de> <580E516D.7060502@gmail.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 18:52:22 -0000 On Mon, 24 Oct 2016 14:22:37 -0400, Ernie Luzar wrote: > ping_ returns this message ping_: Command not found > % ping_ returns this message %: Too many arguments You need to use your imagination: the % just indicates the C shell's prompt, and the underscore was meant to represent the cursor on that line. :-) % _ therefore simply symbolized a user's csh with no text entered so far. :-) > What "subject" in the questions archive list should I search on to find > the thread talking about searching the command history list? I think it was related to "history search". I will search my local archives... just a "little moment"... okay, I think I found something: thread "minor vi/vim qstn" from 09/2013 This is the result which you can turn into an alias or a shell script: history 10 | awk 'BEGIN {histcmds=10} {printf("\t%2d\t%s\n", -(histcmds-i), $0); i++}' | grep -v "histcmds" The initial purpose (which I forgot) was to output the "statement numbers" (for the "!" command), finally as a precmd command (printed before the next prompt). With an additional grep added, this could be useful so you don't get "overwhelmed" by too many search results. By inserting a "non-standard identifier" into the sed part you can probably deal even better with possible false positives. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...