Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Oct 2017 12:47:59 -0700
From:      Devin Teske <devin@shxd.cx>
To:        Cy Schubert <Cy.Schubert@komquats.com>
Cc:        Warner Losh <imp@bsdimp.com>, Ed Maste <emaste@freebsd.org>, Eitan Adler <eadler@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r325092 - head/usr.bin/fortune/datfiles
Message-ID:  <B855A05D-E1BB-485F-AB8D-9F9656F531CC@shxd.cx>
In-Reply-To: <201710291851.v9TIpM0I073542@slippy.cwsent.com>
References:  <201710291851.v9TIpM0I073542@slippy.cwsent.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Oct 29, 2017, at 11:51 AM, Cy Schubert <Cy.Schubert@komquats.com> wrote=
:
>=20
> In message <CANCZdfrE1oHqoTFFagVz3xHbK-oiFrPy3+rtF2cOjpzu=3DevhQg@mail.gma=
il.c
> om>
> , Warner Losh writes:
>> --94eb2c114c9a7c3c21055cb3566c
>> Content-Type: text/plain; charset=3D"UTF-8"
>>=20
>>>> On Sun, Oct 29, 2017 at 8:26 AM, Ed Maste <emaste@freebsd.org> wrote:
>>>>=20
>>>> On 29 October 2017 at 00:53, Eitan Adler <eadler@freebsd.org> wrote:
>>>> Author: eadler
>>>> Date: Sun Oct 29 04:53:33 2017
>>>> New Revision: 325092
>>>> URL: https://svnweb.freebsd.org/changeset/base/325092
>>>>=20
>>>> Log:
>>>> Modernize freebsd-tips a bit
>>> ...
>>>> %
>>>> Want to run the same command again?
>>>> -In tcsh you can type "!!".
>>>> +Type "!!".
>>>> %
>>>=20
>>> $ !!
>>> sh: !!: not found
>>>=20
>>> I doubt many people use /bin/sh as an interactive shell, but the tip
>>> ought not lead those who do astray
>>=20
>> Yes. /bin/sh on FreeBSD doesn't grok it, though bash and some other shell=
s
>> available as ports do. I think that the old text was a bit better.
>=20
> Or better yet, ctrl-r in bash and zsh, or up-arrow in tcsh.

Since we are responding to emaste's astute observation with random personal f=
avorites when it comes to history actions in an interactive shell...

How about Esc-P and Esc-N?

Never used it, you say? Few people do.

Try this:

Esc-P
(a colon appears)
(type a portion of the event you are looking for and press ENTER)
Found it? Good.
Didn't find it? Esc-P then ENTER to repeat search further back.
Keep typing Esc-P, ENTER until you find it.
Oh, you went too far? Esc-N, ENTER to search forward from the last matched e=
vent.

Sometimes I show this to co-workers and they shake their head and go back to=
 Ctrl-R.

Ctrl-R is ok, but doesn't enable an Esc-N-like functionality by default. But=
 if you execute (or put in your shell profile) "stty -ixon" then you can use=
 Ctrl-S to reverse the search order during a Ctrl-R search.

For example:

Ctrl-r
(a prompt appears)
(type some text; don't hit ENTER)
Ctrl-r until you find the one you want
Went too far?
Ctrl-s to switch from reverse-search to forward-search
Ctrl-s until you find one you want

Just thought I would share this random info.

As for the fortune statement...

I agree with emaste, "Type !!" is misleading. Old statement of "in tcsh you c=
an type !!" was fine because tcsh is the only shell in base that supports th=
at feature. However, possible alternatives to "Type !!" could be:

Try "!!" (works in many shells but not all).

NB: Trying to make a future-proof statement so the fortune datfile doesn't h=
ave to be onerously maintained.
--=20
Devin=




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B855A05D-E1BB-485F-AB8D-9F9656F531CC>