Re: How to enable infinite command history

2012-02-01 Thread suvayu ali
On Tue, Jan 31, 2012 at 18:23, Dennis Williamson
 wrote:
> I have the same use case. Try one of my logging functions at
> http://stackoverflow.com/945288/26428

That link doesn't work for me, but I think you meant this question:


I personally use this:

export HISTTIMEFORMAT="(%F %T %Z) "
export PROMPT_COMMAND="history 1 >> $HOME/.history-timestamp;"

works great so far.

-- 
Suvayu

Open source is the future. It sets us free.



printf -v array[$i] "%b" "" poisons array causing segfault later

2012-02-01 Thread Jim Avera

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib 
  -g -O2 -Wall
uname output: Linux lxjima 3.0.0-15-generic #26-Ubuntu SMP Fri Jan 20 
17:23:00 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.2
Patch Level: 10
Release Status: release

Description:

If printf is used to set an array element, and the format
contains %b and the corresponding arg is empty, then the
array is somehow poisoned such that later use of array[*] or [@]
causes a segfault.

No segfault occurs if the string interpolated by %b is not empty,
or if %s is used instead of %b (in those cases, setting an array
element with printf seems to work fine).

Repeat-By:
   bash -c 'declare -a ary; printf -v ary[0] "%b" ""; x="${ary[*]}"'

#!/bin/bash
declare -a ary
printf -v ary[0] "%b" ""
echo "after printf"
x="${ary[*]}"  # segfaults here
echo "after use"



Re: How to enable infinite command history

2012-02-01 Thread lina
You mean the bash history fliter,

can flit away those repeated more than twice and those cd .. and
something basic.