Re: bash-4.1.5 crashes when trying to edit multiline command in vi mode

2010-04-16 Thread Chet Ramey
On 4/15/10 9:51 AM, Roman Rakus wrote: > In bash-4.1 patchlevel 5 (probably all older versions) crashes. > Reproducer: > > 1. set -o vi #set ups vi command line editing > 2. type the following command as seen, but do not hit enter at last one > for i in `ls` > do > echo $i > done > 3.After typein

Help with sed

2010-04-16 Thread Radim
Hello, I have such script: (ONLY THIS THREE LINES ARE THE COMMANDS ) content=$(cat $script | sed '/function codecs/,/fi;/d'); content=$(echo $content | sed -n '/mandriva/,/fi;}/p'); content=$(echo $content | sed '/^\s*urpmi[:space:]--auto/p'); But it doesn't work as I would expected. This is

Re: Help with sed

2010-04-16 Thread Radim
Radim wrote: > > What I try to do: > 1) To delete the codecs function of the output. > 2) To get the "if mandriva" block > 3) from that block to get lines of urpmi > > Anybody help? > Or better this: content=$(cat $script | sed '/function codecs/,/fi;/d;/function*\}/p'); # get functions tha

File descriptor leak in nested functions

2010-04-16 Thread Charles Duffy
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

Re: File descriptor leak in nested functions

2010-04-16 Thread Charles Duffy
The provided reproducer was unnecessarily complicated. The following also reproduces the issue: function get_fd_count() { local fds cd /proc/$$/fd; fds=( * ) # avoid a StackOverflow source colorizer bug echo "${#f...@]}" } function fd_leak_func() { while : ; do

Re: Feature request: Can bash provide some mechanism for locking/unlocking?

2010-04-16 Thread Andreas Schwab
"Clark J. Wang" writes: > And flock can only run external commands, it cannot do with things like bash > builtins or functions. You can also pass flock a file descriptor, which allows you to define a critical region inside your script. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key