Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Robert Elz Newsgroups: gnu.bash.bug Subject: Re: Combination of "eval set -- ..." and $() command substitution is slow Date: Tue, 16 Jul 2019 00:49:07 +0700 Lines: 25 Approved: bug-bash@gnu.org Message-ID: References: <8091.1563212947@jinx.noi.kre.to> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1563213027 28115 209.51.188.17 (15 Jul 2019 17:50:27 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: astian Envelope-to: bug-bash@gnu.org In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:3c8:9009:181::2 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: <8091.1563212947@jinx.noi.kre.to> X-Mailman-Original-References: Xref: csiph.com gnu.bash.bug:15173 Date: Wed, 10 Jul 2019 17:21:00 +0000 From: astian Message-ID: I doubt it makes any difference to the timing, which I think Chet has already answered, but it is worth pointing out that these two commands ... printf '%s\n' "`printf %s "$i"`" printf '%s\n' "$(printf %s "$i")" which (I believe)) are supposed to be the same thing, using the different (ancient, and modern) forms of command substitution aren't actually the same. In the first $i is unquoted, in the second it is quoted. Here, since its value is just a number and IFS isn't being fiddled, there is not likely to be any effect, but if you really want to make those two the same, the first needs to be written as printf '%s\n' "`printf %s \"$i\"`" Such are the joys of `` command substitutions (just avoid them). kre