[Toybox] Would someone please explain what bash is doing here?

Chet Ramey chet.ramey at case.edu
Thu Mar 12 07:29:08 PDT 2020


On 3/11/20 10:41 PM, James McMechan wrote:

> Well some of that is the glob() function or maybe wordexp(). My thought was
> to make it so that when glob() hit a file named "-rf" to expand it would
> expand it to "./-rf" to prevent people from being "too clever by half" 

That defeats the strategy of creating a file named `-i' in valuable
directories. I've used this approach.

> making it so the simple ".*" would not expand to either "." or ".." 

The bash glob code has a variable to control that, but it's not user-
visible.

> 
> Also <Tab key> expansion of arguments should use the same or similar
> logic... so "rm -<Tab>" -> "rm ./-" if there is a file "./-" would help.

This is something to suggest to the bash-completion folks.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet at case.edu    http://tiswww.cwru.edu/~chet/



More information about the Toybox mailing list