Problem with extglob patterns used in HISTIGNORE

2010-08-06 Thread Dimitar DIMITROV
Configuration Information:

Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i68   ↪ 6-redhat-linux-gnu' 
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAV   ↪ E_CONFIG_H -DRECYCLES_PIDS   -I.  -I. -I./include -I./lib  
-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFS   ↪ ET_BITS=64 -O2 -g -pipe 
-Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-s   ↪ 
ize=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables
uname output: Linux pal.sandbox 2.6.18-194.8.1.el5 #1 SMP Thu Jul 1 
19:07:06 
EDT 2010 i686 i686 i386 GNU/Li   ↪ nux
Machine Type: i686-redhat-linux-gnu

Bash Version: 3.2
Patch Level: 25
Release Status: release

Description:

The extended glob pattern @(?|??|???|)*([[:space:]]):*([[:space:]])
is not respected when used for the HISTIGNORE environment variable:

export HISTIGNORE='@(?|??|???|)*([[:space:]]):*([[:space:]])'

I think the problem is caused by the colons in [[:space:]] conflicting with
the colons delimiting the different patterns (two in this case). I have to
use sligthly different patterns to work around the issue:

export HISTIGNORE="@(?|??|???|)*( |$'\t'):*( |$'\t')"

Repeat-By:

export HISTIGNORE='@(?|??|???|)*([[:space:]]):*([[:space:]])'






Re : Problem with extglob patterns used in HISTIGNORE

2010-08-06 Thread Dimitar DIMITROV
> On Thu, Aug 05, 2010 at 10:09:38AM +0000, Dimitar DIMITROV wrote:
> >The extended glob pattern @(?|??|???|)*([[:space:]]):*([[:space:]])
> >is not respected when used for the HISTIGNORE environment variable:
> >
> >export HISTIGNORE='@(?|??|???|)*([[:space:]]):*([[:space:]])'
>
> This issue came up in IRC.  I was able to duplicate the problem with a
> much simpler case.
>
> This works as expected:
>
>   imadev:~$ shopt -s extglob
>   imadev:~$ HISTIGNORE='a*( )'
>   imadev:~$ a<-- I typed two spaces at the end
>   bash: a: command not found
>   imadev:~$ history | tail -3
>   1273  shopt -s extglob
>   1274  HISTIGNORE='a*( )'
>   1275  history | tail -3
>
> This fails:
>
> imadev:~$ HISTIGNORE='a*([[:space:]])'
> imadev:~$ a  <-- again, I typed two spaces at the end
> bash: a: command not found
> imadev:~$ history | tail -3
>   1276  HISTIGNORE='a*([[:space:]])'
>   1277  a
>   1278  history | tail -3
>
> Background: apparently he is in the habit of typing "curl" or "curl " a
> lot, and wants them not to appear in his history.  So he was trying to
> set HISTIGNORE='@(wget|curl)*([[:space:]])' and it was not working as
> expected.

It is aliases like l, ll, .., - or simple commands like vi that I don't
want to appear in my history. the [[:space:]] is for cases where I typed
v and it expanded to vim