View Single Post
Old 05-06-2012, 11:16 AM   #162
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by knc1 View Post
And a quick reference to the extended test __keyword__:
http://tldp.org/LDP/abs/html/testconstructs.html
The linked page says that "[[" is a keyword, but "[" is a built-in command. To clarify: the kindles use busybox, and although /bin contains symlinks that point to busybox, it appears that they are only used if you launch a non-busybox shell. Busybox does NOT follow the search path for commands that it has built-in, even if symlinks are provided. Replacing /bin symlinks to point to different programs only works from within a different shell (like a "real" bash).
Quote:
Originally Posted by NiLuJe View Post
Ah, thanks geekmaster, I indeed dimly remember starting using double brackets everywhere to save some forks
In the case of the kindles, using the "[[" keyword instead of the "[" implicit command may well save a process fork (another instance of busybox), but if busybox is already cached, either way should be reasonable fast (you are running interpreted scripting code after all...), but I think that there were OTHER benefits to using "[[" as I recall (enough to convince me to use the extra characters when I normally use the shortest commands to fit more on a line, but I do not remember the detals).


Last edited by geekmaster; 05-06-2012 at 11:30 AM.
geekmaster is offline   Reply With Quote