On 1/11/14, 5:54 PM, Tim Friske wrote: > Hi, > > executing the following code in GNU bash, Version 4.2.45(1)-release > (x86_64-redhat-linux-gnu), Fedora 19 ... > > shopt -s extglob > export > HISTIGNORE="!(+(!([[\:space\:]]))+([[\:space\:]])+(!([[\:space\:]])))" > declare -p HISTIGNORE > > ... brings bash to a full stop. It does not print a command prompt > hereafter. Why is that.
The matcher blows up and goes exponential when the backslashes are in there. I didn't investigate why. > Background: > > All I want to tell bash is to ignore any simple, i.e. one word > command. Bash should not remember command lines like `cd`, `pwd`, > `history`, etc. My original definition of the `HISTIGNORE` variable > looked like this: > > export HISTIGNORE="!(+(!([[:space:]]))+([[:space:]])+(!([[:space:]])))" > > I added a `\` backslash character before each `:` colon character > because according to the `bash` info pages the latter separates each > (extended) shell glob, i.e. pattern from another. Without escaping the > single pattern does not have any effect and a simple command still > makes it into history. You don't need the backslashes; the colons are part of the patterns. The ignore pattern parser understands pattern syntax, so the colons in the bracket expressions don't split the value. The HISTIGNORE value without the backslashes seems to work using bash-4.2.45: single-word simple commands are not added to the history list. 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/