From owner-svn-src-all@freebsd.org Tue Oct 31 04:33:38 2017 Return-Path: Delivered-To: svn-src-all@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 4996AE4D6C4; Tue, 31 Oct 2017 04:33:38 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (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 376AF3249; Tue, 31 Oct 2017 04:33:38 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=50555 helo=[10.0.0.105]) by shxd.cx with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1e9MMS-000Mze-AL; Tue, 31 Oct 2017 02:33:04 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r325092 - head/usr.bin/fortune/datfiles From: Devin Teske X-Mailer: iPhone Mail (13G36) In-Reply-To: Date: Mon, 30 Oct 2017 21:33:35 -0700 Cc: Alexey Dokuchaev , "src-committers@freebsd.org" , Eitan Adler , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Cy Schubert , Ed Maste , Warner Losh Content-Transfer-Encoding: quoted-printable Message-Id: <9CD7866D-BF74-4618-8FFE-E9C47D4DA328@shxd.cx> References: <201710291851.v9TIpM0I073542@slippy.cwsent.com> <20171030151627.GA74374@FreeBSD.org> <3CB26689-0D12-4E69-9BBA-58CCC3B71F3F@shxd.cx> To: Dan Mack X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Oct 2017 04:33:38 -0000 > On Oct 30, 2017, at 2:35 PM, Dan Mack wrote: >=20 > Devin Teske writes: >=20 >> Better in bash which allows you to filter not only on "begins with" >> but also "contains" (which is arguably more valuable than "begins >> with"). >=20 > Definately different. Better? Typical session of editing exim acls on the mail server: 1. Log in via ssh to bash 2. Esc-P vi ENTER (pulls up "sudo vi /usr/local/etc/exim/acls/relay_domains") 3. ENTER 4. Make changes in vi, save, exit 5. Esc-P restart ENTER (pulls up "sudo service exim restart") 6. ENTER Ok, so if I was using tcsh, I cannot call this "better": 1. Log in via ssh to tcsh 2. sudo vi Esc-P (pulls up "sudo vi /usr/local/etc/exim/acls/relay_domains") 3. ENTER 4. Make changes in vi, save, exit 5. sudo service exim r Esc-P (pulls up "sudo service exim restart") 6. ENTER As you can see, being able to match on contents rather than begins-with save= s me valuable keystrokes and allows me to find history elements faster with l= ess effort. Take the example of using "service". Imagine: 1. Esc-P restart 2. Esc-P stop 3. Esc-P reloas Etc. Using the tcsh implementation you simply cannot navigate the history sequent= ially like that. However... there is the fallback of history substitution to pluck elements i= n tcsh which also works in bash: !?text?:p This will copy the most recent history element containing "text" onto the to= p of the history. In bash you can turn on histverify (using shopt) which will allow you to use= simply "!?text" (without quotes) to pull up the previous command containing= "text". In tcsh and zsh -- which lack the histverify shell option -- the sy= ntax "!?text" will still work but without the "?:p" modifier will execute th= e match right away. However, this cross-shell history substitution feature does not allow matchi= ng on "begins-with", only "contains," and as-such is not as flexible as bash= 's Esc-[PN] feature. Though, I admittedly use history expansion a lot too. --=20 Devin