On 8/8/11 2:44 PM, Linda Walsh wrote: > > I was testing functions in my shell, I would cut/paste, > thing is, with each past, I'd get my dir listed (sometimes multiple times) > on each line entered. > > Now I have: > shopt: > no_empty_cmd_completion on > > i.e. it's not supposed to expand an empty line
Not quite. It's supposed to suppress command completion in those contexts where bash would attempt it if the word to be completed is empty. That includes empty lines, but there are other cases as well. The `empty' refers to the command name, not the command line. > but type in > function foo { > <tab>return 1 > } > ---- > When I hit tab it lists out all the files in my dir -- which > explains why when I cut/paste, any tab-indented line will list > out the dir, and if it is multiply indented, it will be listed > once for each indent level! Yes. It's not attempting command completion, since it doesn't think it's in a context where a command name is expected (the completion line parsing is pretty ad-hoc -- it doesn't use the shell parser). It's attempting readline's default filename completion. I'll have to see whether it can be taught that this is a context where a command name is valid, even though it's the second line of a multi-line construct. If this is really a big deal, you can temporarily turn off command line editing while cutting and pasting text into the shell. That way you won't be surprised. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/