Path: csiph.com!goblin3!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Ilkka Virta Newsgroups: gnu.bash.bug Subject: Re: Expand first before asking the question "Display all xxx possibilities?" Date: Thu, 6 Aug 2020 15:13:30 +0300 Lines: 32 Approved: bug-bash@gnu.org Message-ID: References: <871rkoslni.5.fsf@jidanni.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: usenet.stanford.edu 1596716023 29697 209.51.188.17 (6 Aug 2020 12:13:43 GMT) X-Complaints-To: action@cs.stanford.edu To: Chris Elvidge , bug-bash@gnu.org Envelope-to: bug-bash@gnu.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 In-Reply-To: Content-Language: en-US X-SASI-RCODE: 200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; h=subject:to:references:from:message-id:date:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtp; bh=sNfuRI8lT1YItGqYyfKe/+8+vCIv6MFcUYbVSrFys0U=; b=ZsMQ6AtTP6iGnUdnXoa8lYxuaidUYyxqO71UTtzzfujy6SI3xWvsz4pqcQv2Ef/CbB22RtK+tf/P44Ae55L6i00n95yyozaSay+yqiBBSIDav4O9BwDG2d0j94hmc342pkWpmgU0hx+DtLZmIMY6T9ywZnBkXT+TW6Ji+V4SaULuI0NLOjN0F2mPNlqsonTzbk6QoERF9DShcgIAXR1Z+TggDF/YfLRi7xjIix8yAn3XacnJmvRkL1e10ESIXjAouuKhndWgMIZ6emEPeMxNTuzKMm0u9MfU7PWsDCCYenJzwVnRIegiJxVbLzAghCVTcMLBbVsYlobJF/ta+nUiuA== Received-SPF: neutral client-ip=157.24.2.213; envelope-from=itvirta@iki.fi; helo=smtp-in-1.cc.lut.fi X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/06 08:13:31 X-ACL-Warn: Detected OS = FreeBSD 8.x X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: X-Mailman-Original-References: <871rkoslni.5.fsf@jidanni.org> Xref: csiph.com gnu.bash.bug:16703 On 5.8. 22:21, Chris Elvidge wrote: > On 05/08/2020 02:55 pm, Chet Ramey wrote: >> On 8/2/20 6:55 PM, 積丹尼 Dan Jacobson wrote: >>> how about doing the expansion first, so entering >>> $ zz /jidanni_backups/da would then change into > >> $ zz /jidanni_backups/dan_home_bkp with below it the question > >> Display all 113 possibilities? (y or n) > > What happens if you have: > dan_home-bkp, dan_home_nobkp, dan-home-bkp, dan-nohome-bkp, > dan_nohome-bkp (etc.) in /jidanni_backups/? > Which do you choose for the first expansion? I think they meant the case where all the files matching the given beginning have a longer prefix in common. The shell expands that prefix to the command line after asking to show all possibilities. $ rm * $ touch dan_home_bkp{1..199} $ ls -l da[TAB] Display all 199 possibilities? (y or n) [n] $ ls -l dan_home_bkp[cursor here] So the shell has to fill in the common part anyway, and it might as well do it first, without asking. (Which just so happens to be what Zsh does...) -- Ilkka Virta / itvirta@iki.fi