Re: 3 simple steps to make booting/shutdown faster...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Behdad Esfahbod wrote:
On Sun, 17 Feb 2008 08:15:20 -0800, Arjan van de Ven wrote

This should really be fixed in bash to short-circuit.
well......... not sure it can be done in the bash language.
(it may well guarantee that both get executed)

There's nothing to execute there.  All the expansions happen first, so
if you have things like [ -n "$something" -a "`id`" = 0 ], the `id` call
is made before passing control to "test".  The short-circuit would just
happen in the evaluation in test.  There's no user-visible difference
there.

If thats the case shouldn't a statement like that always be nested so that `id` is not called if it is not necessary, possibly saving many disk accesses? It would seem that using the more complex constructs could be much slower if all the cases are evaluated before testing any of them.

--
Andrew Farris <lordmorgul@xxxxxxxxx> www.lordmorgul.net
 gpg 0xC99B1DF3 fingerprint CDEC 6FAD BA27 40DF 707E A2E0 F0F6 E622 C99B 1DF3
No one now has, and no one will ever again get, the big picture. - Daniel Geer
----                                                                       ----

--
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux