Re: crash when using associative array and integer variable

2010-11-08 Thread Roman Rakus
On 07/28/2010 08:46 AM, Roman Rakus wrote: Repeated in the bash-4.0.38 and bash-4.1.7 by the script; #!/bin/bash typeset -Ai s y='*' z='[' s[$y]=1 s[$z]=2 (( s[$z] = s[$z] + ${s[$y]} )) (( s[$y] = s[$y] + ${s[$z]} )) [[ ${s[$y]} = 4 ]] && echo "ok" --

Inconsistency of physical / logical directory structure and tab completion

2010-11-10 Thread Roman Rakus
$ tree -p . ├── [-rwxrwxr-x] out_bin ├── [-rw-rw-r--] out_not_bin ├── [drwxrwxr-x] out_of_recursion └── [drwxrwxr-x] recursion ├── [-rwxrwxr-x] bin ├── [lrwxrwxrwx] in -> ../recursion/ ├── [-rw-rw-r--] not_bin └── [drwxrwxr-x] without 4 directories, 4 files let's go into recursion dir $ cd recu

Re: Inconsistency of physical / logical directory structure and tab completion

2010-11-10 Thread Roman Rakus
On 11/10/2010 05:25 PM, Roman Rakus wrote: $ tree -p . ├── [-rwxrwxr-x] out_bin ├── [-rw-rw-r--] out_not_bin ├── [drwxrwxr-x] out_of_recursion └── [drwxrwxr-x] recursion ├── [-rwxrwxr-x] bin ├── [lrwxrwxrwx] in -> ../recursion/ ├── [-rw-rw-r--] not_bin └── [drwxrwxr-x] without Ah, there

Re: Why `echo -n hello | while read v; do echo $v; done' prints nothing?

2010-12-02 Thread Roman Rakus
On 12/02/2010 12:04 PM, Clark J. Wang wrote: Following command also prints nothing, confused :( for ((i = 0; i< 10; ++i)); do echo -n " $i"; done | while read v; do echo $v; done read wants to read one line, but you don't end your line. try this two examples: $ printf '1 2 3 4' | while read v

Consume only up to 8 bit octal input for backslash-escaped chars (echo, printf)

2010-12-07 Thread Roman Rakus
This one is already reported on coreutils: http://debbugs.gnu.org/cgi/bugreport.cgi?msg=2;bug=7574 The problem is with numbers higher than /0377; echo and printf consumes all 3 numbers, but it is not 8-bit number. For example: $ echo -e '\0610'; printf '\610 %b\n' '\610 \0610' Should output: 10

Re: Consume only up to 8 bit octal input for backslash-escaped chars (echo, printf)

2010-12-07 Thread Roman Rakus
Sorry for wrong indents. Patch in attachment. RR diff -up bash-4.1/builtins/printf.def.octal bash-4.1/builtins/printf.def --- bash-4.1/builtins/printf.def.octal 2010-12-07 15:40:24.0 +0100 +++ bash-4.1/builtins/printf.def2010-12-07 16:13:41.0 +0100 @@ -734,11 +734,15 @@ t

Re: Consume only up to 8 bit octal input for backslash-escaped chars (echo, printf)

2010-12-09 Thread Roman Rakus
On 12/08/2010 02:19 AM, Chet Ramey wrote: On 12/7/10 11:12 AM, Roman Rakus wrote: This one is already reported on coreutils: http://debbugs.gnu.org/cgi/bugreport.cgi?msg=2;bug=7574 The problem is with numbers higher than /0377; echo and printf consumes all 3 numbers, but it is not 8-bit number

Re: for; do; done regression ?

2011-01-10 Thread Roman Rakus
On 01/10/2011 05:24 PM, Marc Herbert wrote: Le 10/01/2011 13:38, Greg Wooledge a écrit : Don't use seq, ever, because it's Linux-only and is a stupid way to count when bash has builtin integer arithmetic.") seq is not exactly Linux-only but GNU-only. GNU-specific versus bash-specific, which is

Re: Here strings and pathname expansion

2011-02-14 Thread Roman Rakus
On 02/14/2011 06:43 AM, Jan Schampera wrote: Hello world, I recently answered a question about using the asterisk mixed with redirection and other words. This also lead me to the documentation that states (REDIRECTION section): --- The word following the redirection operator in the fol

Re: compat31

2011-02-15 Thread Roman Rakus
On 02/14/2011 04:03 PM, Dennis Williamson wrote: I'm having a discussion with someone who claims that for them on Bash 4.0.33, with compat31*off*, they are getting 3.1 behavior with quoted patterns in a =~ match. Is it on Fedora? If so, it was a bug and is fixed since Fedora's bash-4.1.2-1 packa

Parse error in case command

2011-03-03 Thread Roman Rakus
case x"" in.. is falsely parsed. See the example: $ cat test.sh case x"" in x?) printf "unexpected\n" ;; x) printf "expected\n" ;; *) printf "no match\n" ;; esac $ ./bash ./test.sh unexpected $ ./bash --version GNU bash, version 4.2.6(1)-release (x86_64-unknown-linux-gnu) x"

Re: quoting issue in GCC's gcc/config.gcc ?

2011-03-03 Thread Roman Rakus
On 03/03/2011 07:08 PM, Greg Wooledge wrote: unset a; case X"${a}" in X) echo good;; *) echo bad;; esac It's the same as I wrote few seconds before. X"${a}" is parsed to X\117. RR

Re: quoting issue in GCC's gcc/config.gcc ?

2011-03-03 Thread Roman Rakus
On 03/03/2011 08:12 PM, Chet Ramey wrote: Here's a fix. This is very similar to bash42-004. Seems it fixed it. But not done more testing. RR

Re: [bash-bug] no local bash_history created or written to if existing (~/.bash_history

2011-03-08 Thread Roman Rakus
On 03/08/2011 12:32 PM, Dr. Werner Fink wrote: Something like the attached patch. Seems it doesn't work. I have applied your patch, run that bash in gnome-terminal, close the terminal. In gdb I set a break to atexit() and maybe_save_shell_history() functions. Bash receives SIGHUP, I say conti

Re: [bash-bug] no local bash_history created or written to if existing (~/.bash_history

2011-03-08 Thread Roman Rakus
On 03/08/2011 06:02 PM, Chet Ramey wrote: I really wish there was a better solution to the close button problem than SIGHUP. +1, or learn people to exit from shell. RR

Enhancement - hostname in punycode format

2011-03-10 Thread Roman Rakus
Is there any interest to support hostnames in punycode format? I mean to display unicode resresentation rather than ascii (punycode). RR

Infinite loop in globbing

2011-03-14 Thread Roman Rakus
$ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8"

Re: Infinite loop in globbing

2011-03-14 Thread Roman Rakus
On 03/14/2011 02:59 PM, Greg Wooledge wrote: On Mon, Mar 14, 2011 at 10:00:14AM +0100, Roman Rakus wrote: $ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en

Re: Infinite loop in globbing

2011-03-15 Thread Roman Rakus
On 03/14/2011 07:36 PM, Chet Ramey wrote: Here's a minimal patch. Chet Thanks. It is working. I mean no infinite loop. RR

Re: exported variable and tab

2011-03-28 Thread Roman Rakus
On 03/28/2011 06:56 PM, Matias A. Fonzo wrote: Hi there, I have bash 4.2.8(2)-release with readline 6.2 running on GNU/Linux. I've exported a variable and when I press TAB, the result is a backslash. For example, with the case of the $HOME variable: $ mkdir $HOME/test $ cd $HOME/test The resu

bashref - FUNCNEST

2011-04-05 Thread Roman Rakus
The FUNCNEST variable is described unnecessarily twice. In section 3.4 Shell Functions, pages 16 and 17. RR

Re: bashref - FUNCNEST

2011-04-05 Thread Roman Rakus
On 04/05/2011 03:43 PM, Roman Rakus wrote: The FUNCNEST variable is described unnecessarily twice. In section 3.4 Shell Functions, pages 16 and 17. RR As always I've done mistakes. It is section 3.3. The version of bash is 4.2 (the latest released). RR

Re: test -x bug under FreeBSD

2011-04-08 Thread Roman Rakus
On 04/07/2011 02:30 PM, Igor Prokopenkov wrote: Hello, Please take a look at this bug http://www.freebsd.org/cgi/query-pr.cgi?pr=156225 Any chance to get it fixed? Thanks. Already discussed. See http://www.mail-archive.com/bug-bash@gnu.org/msg07152.html RR

bash trap ignore signal - race condition

2011-04-12 Thread Roman Rakus
There's a race condition when you can hit following: set_signal_handler (sig, SIG_IGN); change_signal (sig, savestring (string)); set_signal_handler (sig, trap_handler); in trap.c file, set_signal() function. So bash set signal to be ignored and then set it to be handled by trap

Re: bash trap ignore signal - race condition

2011-04-12 Thread Roman Rakus
On 04/12/2011 03:30 PM, Chet Ramey wrote: Probably because it's very old code. That has been there essentially unchanged since at least bash-1.12 -- almost twenty years ago. It would be better to block the signal while the trap string and handler are being modified. Chet Thanks for the answer.

Re: bash trap ignore signal - race condition

2011-04-13 Thread Roman Rakus
On 04/13/2011 03:45 PM, Chet Ramey wrote: On 4/12/11 11:04 PM, Roman Rakus wrote: On 04/12/2011 03:30 PM, Chet Ramey wrote: Probably because it's very old code. That has been there essentially unchanged since at least bash-1.12 -- almost twenty years ago. It would be better to bloc

Re: bash trap ignore signal - race condition

2011-04-13 Thread Roman Rakus
On 04/14/2011 03:07 AM, Roman Rakus wrote: Or document current behavior. What about following? diff -up bash-4.2/doc/bash.1.trap bash-4.2/doc/bash.1 --- bash-4.2/doc/bash.1.trap2011-04-14 08:10:47.0 +0200 +++ bash-4.2/doc/bash.1 2011-04-14 08:15:34.0 +0200 @@ -9424,6

Re: bash trap ignore signal - race condition

2011-04-15 Thread Roman Rakus
On 04/14/2011 03:09 PM, Chet Ramey wrote: I'm not sure I understand this. Why is using a temporary handler better than blocking the signal until the trap handler is in place, then unblocking it and allowing any pending signal to be delivered? I just want some way to not ignore the signal. For

Re: Question about arithmetic logic.

2011-04-18 Thread Roman Rakus
On 04/18/2011 04:30 PM, Steven W. Orr wrote: I happen to be running GNU bash, version 4.0.35(1)-release (x86_64-redhat-linux-gnu) I create an integer variable and assign it either a 0 or a 1. The arithmetic test always returns success regardless of value. For example: typeset -i ss=0 (( ss

Re: Segfaults on some libtool invocations due to sbrk() assumptions

2011-04-26 Thread Roman Rakus
On 04/26/2011 09:38 PM, Chet Ramey wrote: The attached patch fixes the crashes by simply removing the caching, which is useless anyway since libc already avoids calling the kernel system call when sbrk is given 0. Thanks for the patch. It's dangerous to assume the whole world is Linux or glibc.

printf builtin - improper error report

2011-05-02 Thread Roman Rakus
Using bash 4.1.7: $ printf "ab\nc" > /dev/full bash: printf: write error: No space left on device bash: printf: write error: No space left on device $ /usr/bin/printf "ab\nc" > /dev/full /usr/bin/printf: write error: No space left on device The same is on bash 4.2.8. The second write error is d

Re: Calling Bash with /S

2011-06-23 Thread Roman Rakus
On 06/22/2011 06:59 PM, sweinberger wrote: Hi All, I am calling bash from dmake. The make file initiates the call to bash as follows: /bin/bash /S /c "" /bin/bash -S -c ? Anyway, -S is not valid option in Fedora's bash version 4.1.7. The command to execute is between the double quotes. For

Re: Question about patterns

2011-06-23 Thread Roman Rakus
On 06/23/2011 03:59 PM, Steven W. Orr wrote: I may be wrong, but I think there's a way to do what I want without using a regex. I have a file called foo-1.2-3.tar.gz I need to set a variable equal to foo-1.2-i386-x86_64-3.tar.gz Is there a way to do this without parsing my brains out? I am fac

Re: Question about patterns

2011-06-23 Thread Roman Rakus
On 06/23/2011 04:56 PM, Roman Rakus wrote: On 06/23/2011 03:59 PM, Steven W. Orr wrote: I may be wrong, but I think there's a way to do what I want without using a regex. I have a file called foo-1.2-3.tar.gz I need to set a variable equal to foo-1.2-i386-x86_64-3.tar.gz Is there a way

Re: sorry--this is my question

2011-07-26 Thread Roman Rakus
On 07/23/2011 02:17 PM, Joachim Schmitz wrote: Jan Schampera wrote: On 22.07.2011 18:12, the mad doctor kaeding wrote: is this a bug? echo goodbye\ cruel\ world\! goodbye cruel world! echo "goodbye cruel world!" bash: !": event not found echo "goodbye cruel world\!" goodbye cruel world\!

[PATCH 2/2] Multibyte support for ansic_quote() function

2011-08-16 Thread Roman Rakus
Correctly check for printable characters using wchar_t* and iswprint(). Signed-off-by: Roman Rakus --- bash-4.2/lib/sh/strtrans.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/bash-4.2/lib/sh/strtrans.c b/bash-4.2/lib/sh/strtrans.c index 57f9af0

multibyte support for ansic_* functions

2011-08-16 Thread Roman Rakus
The following two patches add support for multibyte characters in ansic_* functions. Effectively it is changing behaviour of: 1) printf's %q format option 2) command not found error message 3) readline's syntax error message 4) XTRACE output It's a set of two patches.

[PATCH 1/2] Multibyte characters support for ansic_shouldqoute()

2011-08-16 Thread Roman Rakus
Properly check for printable characters in ansic_shouldqoute(). Use wchar_t* and iswprint() instead of isprint() and char*. Signed-off-by: Roman Rakus --- bash-4.2/lib/sh/strtrans.c | 26 +- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/bash-4.2/lib

Re: multibyte support for ansic_* functions

2011-08-16 Thread Roman Rakus
On 08/16/2011 03:42 PM, Roman Rakus wrote: The following two patches add support for multibyte characters in ansic_* functions. Effectively it is changing behaviour of: 1) printf's %q format option 2) command not found error message 3) readline's syntax error message 4) XTRACE outp

Re: conditional aliases are broken

2011-08-18 Thread Roman Rakus
On 08/18/2011 04:38 PM, Sam Steingold wrote: how do I write a function that would print the same as $ \ls | cat f3(){ printf "%s\n" "$@"; } But please move your question like "HOW TO..." somewhere else; comp.unix.shell usenet group or the #bash IRC channel on freenode or... This mailing list

Re: conditional aliases are broken

2011-08-19 Thread Roman Rakus
On 08/18/2011 07:57 PM, Eric Blake wrote: On 08/18/2011 08:53 AM, Roman Rakus wrote: On 08/18/2011 04:38 PM, Sam Steingold wrote: how do I write a function that would print the same as $ \ls | cat f3(){ printf "%s\n" "$@"; } "\n" looks funny in shell; even

Re: multibyte support for ansic_* functions

2011-08-25 Thread Roman Rakus
On 08/16/2011 03:42 PM, Roman Rakus wrote: The following two patches add support for multibyte characters in ansic_* functions. Effectively it is changing behaviour of: 1) printf's %q format option 2) command not found error message 3) readline's syntax error message 4) XTRACE outp

Re: multibyte support for ansic_* functions

2011-08-25 Thread Roman Rakus
On 08/25/2011 02:56 PM, Chet Ramey wrote: On 8/25/11 8:17 AM, Roman Rakus wrote: On 08/16/2011 03:42 PM, Roman Rakus wrote: The following two patches add support for multibyte characters in ansic_* functions. Effectively it is changing behaviour of: 1) printf's %q format option 2) comman

Re: segfault with bad array subscript

2011-09-16 Thread Roman Rakus
On 09/15/2011 08:38 PM, Chet Ramey wrote: Bash Version: 4.1 Patch Level: 5 Release Status: release Description: Accidentally found the bug. This is what I executed: /bin/bash -c 'declare -r a[]=asd' Thanks for the report. I'll take a look. Chet The crash is in builtins/declare.def o

Re: How to match regex in bash? (any character)

2011-09-29 Thread Roman Rakus
On 09/29/2011 06:18 PM, Peng Yu wrote: Also, regex(3) does not mention the difference between $x =~ .txt and $x=~ ".txt". I think that the difference should be addressed in man bash. It is in man bash. RR

Re: [[ str =~ "^pattern" ]] no longer works

2011-11-04 Thread Roman Rakus
On 11/04/2011 09:09 AM, flong@dell1.localdomain wrote: 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-unknown-linux-gn

Another call of async-signal-unsafe function

2011-11-07 Thread Roman Rakus
There's a small chance to call unsafe function (malloc) during signal handling. It occurs during bash 4.2 startup, when user resize window. Occurs on bash configured to use system malloc (not bash malloc). The stack trace: #0 __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64

Re: set -e works incorrectly in subshells

2011-11-23 Thread Roman Rakus
On 11/23/2011 11:26 AM, Марк Коренберг wrote: 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_VENDO

Re: Bash git repository on savannah

2011-11-28 Thread Roman Rakus
On 11/28/2011 06:28 AM, Mike Frysinger wrote: I don't think I'll push every change to git as soon as it happens, but > I'm thinking about fairly frequent commits to a `bash-devel' sort of > tree. The question is whether or not enough people would be interested > in that to make the frequency

Re: '>;' redirection operator

2011-12-25 Thread Roman Rakus
Feel free to write a patch. RR

Process group id of first command in command substitution (bash4 vs bash3)

2012-02-20 Thread Roman Rakus
I'm not sure if it's a bug or not, but there is change between old bash 3.2 and bash 4.2. When you run a script: set -m $(sleep 1; sleep 2) in bash 4.2 the first sleep has same group id as parent shell. However in bash 3.2 it has different group id. Is it bug or not? I'm not able to find docu

Re: Process group id of first command in command substitution (bash4 vs bash3)

2012-02-22 Thread Roman Rakus
On 02/20/2012 10:57 PM, Chet Ramey wrote: I'm not sure if it's a bug or not, but there is change between old bash 3.2 and bash 4.2. When you run a script: set -m $(sleep 1; sleep 2) in bash 4.2 the first sleep has same group id as parent shell. However in bash 3.2 it has different group id. Is

Re: Pathname expansion not performed in Here Documents

2012-02-27 Thread Roman Rakus
On 02/27/2012 01:50 PM, Steven W. Orr wrote: I don't mean this in a snarky way, but shell man pages are historically in the class of docs that you really need to read over and over again. There are a few books on shell programming, most of them not very good, but I personally have read the bash

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Roman Rakus
On 02/28/2012 10:17 AM, lhun...@lyndir.com wrote: Configuration Information [Automatically generated, do not change]: Machine: i386 OS: darwin11.2.0 Compiler: /Developer/usr/bin/clang Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='darwin11.2.0' -DCONF_MACHTYPE='i386-

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Roman Rakus
On 02/28/2012 02:36 PM, Chet Ramey wrote: On 2/28/12 4:17 AM, lhun...@lyndir.com wrote: Configuration Information [Automatically generated, do not change]: Machine: i386 OS: darwin11.2.0 Compiler: /Developer/usr/bin/clang Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYP

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Roman Rakus
On 02/28/2012 05:10 PM, John Kearney wrote: wrap it with single quotes and globally replace all single quotes in the string with '\'' single quote and slash have special meaning so they have to be escaped, that's it. \'${var//\'/\\\'}\' it is not quoted, so it undergoes word splitting. To avoid

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Roman Rakus
On 02/28/2012 05:22 PM, Roman Rakus wrote: On 02/28/2012 05:10 PM, John Kearney wrote: wrap it with single quotes and globally replace all single quotes in the string with '\'' single quote and slash have special meaning so they have to be escaped, that's it. \'${

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Roman Rakus
On 02/28/2012 05:49 PM, Greg Wooledge wrote: On Tue, Feb 28, 2012 at 05:36:47PM +0100, Roman Rakus wrote: And that means, there isn't way to substitute "something" to ' (single quote) when you want to not perform word splitting. I would consider it as a bug. imadev:~$

Re: using the variable name, GROUPS, in a read list

2012-03-07 Thread Roman Rakus
On 03/07/2012 04:54 PM, Jim Meyering wrote: FYI, if I attempt to read into the built-in array variable, GROUPS, this doesn't work: $ bash -c 'while read GROUPS; do echo $GROUPS; done< /etc/passwd'|wc -l 0 Comparing with dash, I see what the author expected, i.e., that the while loop iter

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Roman Rakus
On 03/13/2012 04:08 PM, dethrophes wrote: Am 13.03.2012 06:04, schrieb Clark J. Wang: On Mon, Mar 12, 2012 at 12:22, Yongzhi Pan wrote: Tested in GNU bash, version 3.00.16(1)-release and 4.1.2(1)-release. Upon login, home dir is displayed as tilde in PS1: pan@BJ-APN-2 ~$ echo $PS1 \[\033[35m

Re: Process group id of first command in command substitution (bash4 vs bash3)

2012-03-15 Thread Roman Rakus
On 03/10/2012 09:30 PM, Chet Ramey wrote: On 2/20/12 1:25 PM, Roman Rakus wrote: I'm not sure if it's a bug or not, but there is change between old bash 3.2 and bash 4.2. When you run a script: set -m $(sleep 1; sleep 2) in bash 4.2 the first sleep has same group id as parent shell.

Re: Directory completion problems

2012-04-19 Thread Roman Rakus
On 04/19/2012 12:28 PM, Artur Rataj wrote: ~/projects/art/dev/lib$ cd ../ .bzr/ lib/ ~/projects/art/dev/lib$ cd ../src ~/projects/art/dev/src$ cd ../ .bzr/ lib/ src/ ~/projects/art/dev/src$ cd ../lib ~/projects/art/dev/lib$ cd ../ .bzr/ lib/ Are there any symlinks? RR

Re: Severe Bash Bug with Arrays

2012-04-25 Thread Roman Rakus
On 04/25/2012 06:15 PM, Chet Ramey wrote: On 4/25/12 11:27 AM, Greg Wooledge wrote: On Wed, Apr 25, 2012 at 11:07:57AM -0400, Chet Ramey wrote: z4.local(1)$ ../bash-4.2-patched/bash -c 'echo $BASH_VERSION' 4.2.24(9)-release z4.local(1)$ ../bash-4.2-patched/bash ./x3 foo z4.local(1)$ ./x3 foo I

Re: Possible bug: Race condition when calling external commands during trap handling

2012-05-22 Thread Roman Rakus
On 05/22/2012 02:28 PM, Greg Wooledge wrote: I do not know the answers to "How does bash implement traps? Is there a guarantee that no signals will be lost?" Hopefully someone else does. I can just imagine a situation when the bash is reading trap from the source (is going through the script a

Re: Possible bug: Race condition when calling external commands during trap handling

2012-05-22 Thread Roman Rakus
On 05/22/2012 03:01 PM, Chet Ramey wrote: On 5/22/12 8:41 AM, Roman Rakus wrote: Another situation: You had previous trap handler and you are installing new one. The received signals are "paused" for a while and are processed right after the installation of new trap handler. There

Re: Red-Hat Bug 825751 - bash-completion fails on environment variables

2012-06-08 Thread Roman Rakus
On 06/07/2012 11:22 PM, Linda Walsh wrote: In reading the messages quoted above, I'm not sure some people understand the severity of the bug. I do not. And many people don't understand expansions, quoting, completions and many other... This isn't a matter of preference... its a real bug. Ex:

Re: bash tab variable expansion question?

2012-06-11 Thread Roman Rakus
On 06/11/2012 11:07 AM, John Embretsen wrote: On 06/11/2012 10:10 AM, Pierre Gaston wrote: On Mon, Jun 11, 2012 at 10:59 AM, John Embretsen wrote: On 27 Feb 2011 18:18:24 -0500, Chet Ramey wrote: On Sat, Feb 26, 2011 at 10:49 PM, gnu.bash.bugwrote: A workaround is fine but is the 4.2 behavior

Re: regex in bashexpression doesn't work

2012-06-25 Thread Roman Rakus
On 06/25/2012 09:18 AM, Niels Carl W. Hansen wrote: 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-redhat-linux-gnu'

Re: Massive recursion -> SEGV

2012-07-01 Thread Roman Rakus
On 07/01/2012 02:03 PM, Jan Schampera wrote: Hi folks, a suggestion about recursive function calls (and not only that, of course). Do you see a way for Bash to pull the emergency break before it runs out of stack here (to provide an error to the user, rather than a crash): ---

Re: retrun value of buildin (( )) / GNU bash, version 4.2.24(1)-release (x86_64-pc-linux-gnu)

2012-07-10 Thread Roman Rakus
On 07/10/2012 05:32 PM, Orlob Martin (EXT) wrote: Hallo, I was using the build in (( )) function for count up an index. I think I found a bug in GNU bash, version 4.2.24(1)-release (x86_64-pc-linux-gnu). ((expression)) is one of Compound Commands (not builtin nor function). Quoting the manual

Re: AIX and Interix also do early PID recycling.

2012-07-25 Thread Roman Rakus
On 07/25/2012 04:52 PM, Michael Haubenwallner wrote: Got it: The value used for js.c_childmax isn't 128, but 1024. In lib/sh/oslib.c, getmaxchild() prefers sysconf(_SC_CHILD_MAX) over CHILD_MAX over MAXUPRC. But sysconf(_SC_CHILD_MAX) does return the number of "processes per real user id" (si

Re: AIX and Interix also do early PID recycling.

2012-07-30 Thread Roman Rakus
On 07/25/2012 07:12 PM, Chet Ramey wrote: On 7/25/12 10:57 AM, Roman Rakus wrote: And there is also a problem when you change the `ulimit -u' value. See https://bugzilla.redhat.com/show_bug.cgi?id=832997 It's not clear to me that it's desirable to attempt to remember a potent

Re: bash does filename expansion when assigning to array member in compound form

2012-08-20 Thread Roman Rakus
On 08/20/2012 07:12 PM, Gundi Cress wrote: Am Sat, 18 Aug 2012 19:55:17 +0100 schrieb Stephane Chazelas: 2012-08-18 10:26:22 -0500, Dan Douglas: This is a feature that all shells with this style of compound assignment have in common. If no explicit subscripts are given, the text between the pa

Re: AIX and Interix also do early PID recycling.

2012-08-28 Thread Roman Rakus
On 08/01/2012 03:13 PM, Chet Ramey wrote: On 7/30/12 10:41 AM, Roman Rakus wrote: Hmm... I don't know much about boundaries of maximum number of user processes. But anyway - do you think that (re)changing js.c_childmax (when `ulimit -u' is changed) is not good? Maybe it's ok u

Re: AIX and Interix also do early PID recycling.

2012-08-29 Thread Roman Rakus
On 08/29/2012 04:06 PM, Michael Haubenwallner wrote: On 08/28/2012 09:21 AM, Roman Rakus wrote: On 08/01/2012 03:13 PM, Chet Ramey wrote: On 7/30/12 10:41 AM, Roman Rakus wrote: Hmm... I don't know much about boundaries of maximum number of user processes. But anyway - do you think tha

Undocumented behaviour - parameter expansion ${par-word}

2012-09-04 Thread Roman Rakus
Hi, Petr, adding to cc: list, found behaviour not documented, neither in man page nor bash ref manual: ${par-word} will do expansion of par, and if the par is unset it is substituted by word. It is different from ${par:-word}, where word is used when par is unset or null. Is it undocumented a

Re: Undocumented behaviour - parameter expansion ${par-word}

2012-09-04 Thread Roman Rakus
On 09/04/2012 01:19 PM, Clark WANG wrote: On Tue, Sep 4, 2012 at 7:13 PM, Roman Rakus wrote: Hi, Petr, adding to cc: list, found behaviour not documented, neither in man page nor bash ref manual: ${par-word} will do expansion of par, and if the par is unset it is substituted by word. It is

Unused bash long option --debug

2012-09-14 Thread Roman Rakus
debug long option is not used, however it is declared. Is it for some reason? Backward compatibility? It is a bit misleading, because bash --help shows --debug as a possible option. RR

Bash long option --protected

2012-09-14 Thread Roman Rakus
'protected' long option has effect only when WORDEXP_OPTION is enabled, so this patch remove that option when WORDEXP_OPTION is not enabled. The following patch should clearly apply to master branch.

[PATCH] Enable protected long option only if WORDEXP_OPTION is enabled

2012-09-14 Thread Roman Rakus
Signed-off-by: Roman Rakus --- shell.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/shell.c b/shell.c index 9e74f3b..87f740a 100644 --- a/shell.c +++ b/shell.c @@ -248,7 +248,9 @@ static const struct { { "noprofile", Int, &no_profile, (char **)0x0

Re: Should ~$user be tilde expanded?

2012-10-25 Thread Roman Rakus
On 10/25/2012 04:07 PM, Clark WANG wrote: See following example: $ cat foo.sh u=root echo ~$u $ bash foo.sh # bash 4.2.37 ~root $ ksh foo.sh # ksh 93u+ 2012-08-01 /root $ Anyone can explain/confirm what should be the correct behavior? -Clark http://www.gnu.org/software/bash/manual/bashref.h

Re: RFE: printf '%(fmt)T' prints current time by default

2012-11-14 Thread Roman Rakus
On 11/14/2012 04:00 AM, Clark WANG wrote: In ksh: $ printf '%(%F %T)T\n' 2012-11-14 10:57:26 $ In bash: $ printf '%(%F %T)T\n' 1970-01-01 08:00:00 $ I think the ksh behavior is makes more sense so can we use the current time as the default? -Clark For it there is -1 special parameter for pr

Re: How to initialize a read-only, global, associative array in Bash?

2012-11-27 Thread Roman Rakus
On 11/26/2012 10:45 PM, Tim Friske wrote: Hi folks, Hi I execute the following code in Bash version "GNU bash, Version 4.2.39(1)-release (x86_64-redhat-linux-gnu)": function foobar { declare -rgA FOOBAR=([foo]=bar) } foobar declare -p FOOBAR # Output: declare -Ar FOOBAR='()' I think there

[PATCH] Use size_t for variable list size and length

2012-11-29 Thread Roman Rakus
see https://www.securecoding.cert.org/confluence/display/seccode/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow Signed-off-by: Roman Rakus --- variables.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/variables.h b/variables.h index

Re: [PATCH] Use size_t for variable list size and length

2012-12-02 Thread Roman Rakus
On 12/01/2012 02:47 AM, Chet Ramey wrote: On 11/29/12 5:07 AM, Roman Rakus wrote: see https://www.securecoding.cert.org/confluence/display/seccode/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow I've actually read this. I'm skeptical that this chan

Re: Some globstar patterns produce duplicate entries and a null filename

2012-12-02 Thread Roman Rakus
On 12/01/2012 04:41 PM, Ulf Magnusson wrote: GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu) Take the following example, assumed to be run in an empty directory: $ mkdir a $ echo ** a $ echo **/** a a $ echo **/**/** a a a I would expect the result to be just 'a' in all cases. You

Re: Some globstar patterns produce duplicate entries and a null filename

2012-12-02 Thread Roman Rakus
On 12/02/2012 05:57 PM, Ulf Magnusson wrote: Oh - you need to enable 'globstar', not 'extglob'.:) /Ulf Yes, you're right. Bash incorrectly expands to empty string and duplicated results. RR

Re: Some globstar patterns produce duplicate entries and a null filename

2012-12-05 Thread Roman Rakus
On 12/05/2012 04:07 AM, Chet Ramey wrote: On 12/1/12 10:41 AM, Ulf Magnusson wrote: GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu) Take the following example, assumed to be run in an empty directory: $ mkdir a $ echo ** a $ echo **/** a a $ echo **/**/** a a a I would expect the

Re: Some globstar patterns produce duplicate entries and a null filename

2012-12-11 Thread Roman Rakus
On 12/10/2012 11:29 PM, Chet Ramey wrote: On 12/5/12 3:17 AM, Roman Rakus wrote: Works well when used up to 2 levels of ** - ** and **/** is fixed. However still produce duplicates, when used more levels - **/**/**. Also produce duplicates for **/a/** form. The next version will treat any

Re: tab completion with variable expansion broken

2012-12-11 Thread Roman Rakus
On 12/11/2012 06:03 PM, njhwang wrote: Thanks, this is exactly what I needed to fix the issue on my end as well. I'm curious if anyone who patched bash in this manner started seeing a weird issue with long commands in the terminal? After building bash-4.2.29, long commands would no longer break

Re: No such file or directory

2013-01-02 Thread Roman Rakus
On 01/02/2013 02:25 AM, Mike Frysinger wrote: On Tuesday 01 January 2013 15:10:00 Chet Ramey wrote: On 1/1/13 2:49 PM, Aharon Robbins wrote: Michael Williamson wrote: I have a complaint. Apparently, when unknowingly attempting to run a 32-bit executable file on a 64-bit computer, bash gives th

Re: No such file or directory

2013-01-02 Thread Roman Rakus
On 01/02/2013 03:31 PM, Eric Blake wrote: On 01/02/2013 07:28 AM, Michael Williamson wrote: Hi Aharon, Thanks for your explanation. Now I have another question. Why is the error message for ENOENT simply "No such file or directory", when the man page for execve has this complete description: "T

[PATCH] Fix several missing close() calls.

2013-01-24 Thread Roman Rakus
There are missing calls of close() leading to resource leak (fd leak). Simple reproducer: . / and /proc/$$/fd contain one open fd for each above call Signed-off-by: Roman Rakus --- builtins/evalfile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtins/evalfile.c b/builtins

Re: interrupted system call when using named pipes on FreeBSD

2013-01-30 Thread Roman Rakus
On 01/29/2013 10:59 PM, Chet Ramey wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 1/18/13 1:30 AM, Mike Frysinger wrote: this is somewhat a continuation of this thread: http://lists.gnu.org/archive/html/bug-bash/2008-10/msg00091.html i've gotten more or less the same report in Gentoo:

Re: interrupted system call when using named pipes on FreeBSD

2013-01-30 Thread Roman Rakus
On 01/30/2013 10:06 AM, Roman Rakus wrote: There is similar problem with ioctl() syscall in read. Consider following script: #!/bin/bash ( while :; do kill -CHLD $$ 2>&- || break; done ) & while :; do read -p 1 -t 0.01 -d ' ' done On my Fedora it is reporting many

Re: Should this be this way?

2013-02-26 Thread Roman Rakus
On 02/26/2013 02:03 AM, Linda Walsh wrote: My login shell is /bin/bash (i.e. not /bin/sh); SHELL=/bin/bash as well. Typing 'which bash' gives /bin/bash, and whence bash: bash is /bin/bash. which is not always correct. Use type builtin. I had the foll0wing script which acts differently based on

autoconf 2.69?

2013-03-27 Thread Roman Rakus
Support for the ARM 64 bit CPU architecture (aarch64) was introduced in autoconf 2.69. bash uses an earlier version of autoconf, preventing its being built. Is there any plan to upgrade to version 2.69. Looking at devel branch it is using 2.68. RR

Re: No such file or directory

2013-04-04 Thread Roman Rakus
On 01/02/2013 06:27 PM, Mike Frysinger wrote: that ship has already sailed Sorry for late response, but do you have some link or something? I would like to track it. RR

Re: to - Bookmark file system locations in bash on POSIX-like systems

2013-04-10 Thread Roman Rakus
I think the much better would be to improve getopt command or getopts builtin. RR On 04/10/2013 03:35 PM, dnade@orange.com wrote: Sorry to hack the thread, but I was wondering too if there was actually a place/list to announce such contributions. I've recently developpedhttps://github.co

Re: segfault on rl_completion_matches() interrupt

2013-04-14 Thread Roman Rakus
On 04/15/2013 01:08 AM, Raphaël Droz wrote: Using both 4.2 and 4.3, I can reproduce a segfault on completion (though not using gdb) This can happen very consistently using a time-consuming completion like the one for `man`, eg: $ man g^C Attached is the trace from a core-file using `man gpg-ag

  1   2   >