Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Chet Ramey Newsgroups: gnu.bash.bug Subject: Re: Issues with history substitution and its documentation Date: Tue, 19 Nov 2019 10:11:39 -0500 Lines: 35 Approved: bug-bash@gnu.org Message-ID: References: <643b95db-ca1f-98ff-e8c5-c79581d909d4@case.edu> <0b5c5bcb-27e2-6e59-40d9-0968f814d52b@case.edu> Reply-To: chet.ramey@case.edu NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1574176306 31952 209.51.188.17 (19 Nov 2019 15:11:46 GMT) X-Complaints-To: action@cs.stanford.edu Cc: chet.ramey@case.edu, bug-bash@gnu.org To: Jim Monte Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=case.edu; s=smtp-primary; t=1574176300; bh=JaUkgiUAMDQRTwsqlxDJgaWgxEZNh/L0fYA7BeAnC1k=; h=Reply-To:Cc:Subject:To:References:From:Message-ID:Date: MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=7lgKqI/eKasAJ9/zoEj+j/4zmO8A8PPIgUu2YDXD45koVlDvtRJkkT0zlx8nOlO/1b UWRZ+ei2YbAzceC4LHsqtpJ93kGt1Z3WjZPTWeIpmCMmhQMZQZpyJFnj+LtBC2EUs+h nE0zahEa+1xGIFFhFdi8lNCzBYdkiuaxIAycfCMn2Vp4QEaXFNtfIhJmqsH8PeKqJBG xGiPuq0Tr4+K7PZ9Rppf1nThl5W9CTCorLribidL3FwheRkdsUSpj8PQaWf6b5sv58O vW9bn+AszvzK4Nr/4vzkv7oVkqgUcV4WARFM2b8eBuLOcYYbejo4IFy5vG3ALIp62XC zPVgzLhg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=case.edu; s=smtp-primary; t=1574176299; bh=kQNyqQqfO+YJ9cTybt1RhfN0UIAtNJPpNeH2a+/7lpM=; h=Reply-To:Cc:Subject:To:References:From:Message-ID:Date: MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=gNcbD8TYNol9nqJ3pw3yo74oMq/2NG/rcUFi237maXr1FkdxKuZXJ3ddBhyKLYqa/5 O2CAyRqQWC9oob2MxJhFCqi7OnGY3ZKn/Hb9vEWG1HDLduAGG528AcqgYmHOlWCajx+ Tj3g7rODABfFobAdtS2qg7HCTBU4jU1tmOPYswEy1DE5lBErUygGAIUQDaLIIRQgbqi Y01L7dBFE4tQdqdvLU8sm/OthzJLloXQk9YOwYv0RyE6P3zp99ofWNypEmvMXWuka8e H3WDnUfu2AHGExUVWN1e/KE7IqSnR/6XqQrHP89KrBvt1y3nFJs6C6yNW4e81Zgycmz GFs6WIJQ== User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 In-Reply-To: Content-Language: en-US X-Junkmail-Status: score=8/90, host=mpv2-2015.case.edu X-Junkmail-PrAS-Raw: score=8/90, refid=2.7.2:2019.11.19.135116:17:8.317, ip=, rules=DKIM_SIGNATURE, __HAS_REPLYTO, __HAS_CC_HDR, __MULTIPLE_RCPTS_CC_X2, __SUBJ_REPLY, __PHISH_SPEAR_SUBJ_ALERT, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __TO_MALFORMED_2, __TO_NAME, __TO_NAME_DIFF_FROM_ACC, __HAS_REFERENCES, __REFERENCES, __HAS_FROM, FROM_EDU_TLD, __HAS_MSGID, __SANE_MSGID, DATE_TZ_NA, __USER_AGENT, __MOZILLA_USER_AGENT, __MIME_VERSION, __IN_REP_TO, __CT, __CT_TEXT_PLAIN, __CTE, __REPLYTO_SAMEAS_FROM_ADDY, __REPLYTO_SAMEAS_FROM_ACC, __FROM_DOMAIN_IN_ANY_CC2, __REPLYTO_SAMEAS_FROM_DOMAIN, __DKIM_ALIGNS_1, __DKIM_ALIGNS_2, __ANY_URI, __URI_MAILTO, __URI_WITH_PATH, __URI_NO_WWW, __CP_URI_IN_BODY, __SUBJ_ALPHA_NEGATE, __URI_IN_BODY, __URI_NOT_IMG, __FORWARDED_MSG, __BODY_NO_MAILTO, __NO_HTML_TAG_RAW, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_1200_1299, __MIME_TEXT_P1, __MIME_TEXT_ONLY, __URI_NS, HTML_00_01, HTML_00_10, DKIM_ALIGNS, [TRUNCATED], so=2010-03-03 19:42:08, dmn=2016-08-03-0138 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 129.22.103.227 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <0b5c5bcb-27e2-6e59-40d9-0968f814d52b@case.edu> X-Mailman-Original-References: <643b95db-ca1f-98ff-e8c5-c79581d909d4@case.edu> Xref: csiph.com gnu.bash.bug:15613 On 11/18/19 1:10 PM, Jim Monte wrote: > Thanks again for looking at these reports. I have thankfully essentially > completed my implementation of history for ngspice (an open-source > successor to SPICE 3F5 with a csh-like front end that handles parsing a bit > differently than a shell would), so I believe this report will be the final > one. > > Jim > > Related to the other report, there is some more missing documentation > regarding the :s word modifier. > > If the line ends after "old", it is equivalent to :s/old/new/ (assuming old > and new do not contain '/'). Well, if `new' is null, the instances of `old' are deleted. That's consistent with other history expansions. You can already omit the trailing delimiter if that ends the line. > [root@localhost ~]# echo !:s > echo echo a b c > echo a b c Technically, that's a bad substitution (csh throws an error), since it's missing the delimiter. The readline code just lets it go; that's one of the few places it's less strict than csh. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/