Re: History expansion is strangely re-enabled.

2009-10-31 Thread Andreas Schwab
Pierre Gaston writes: > bash-4.0$ set +H;!((3)) > bash: !: event not found That command line was never executed because history expansion failed. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now fo

Re: 4.0 core dump from printf -v foo %s b

2009-11-12 Thread Andreas Schwab
rminating NUL) if the buffer would be big enough. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: 4.0 core dump from printf -v foo %s b

2009-11-13 Thread Andreas Schwab
Chet Ramey writes: > I try to write to the current (well, ten-year-old) standards. Nothing wrong with that. gnulib has a few macros to detect such problematic implementations that you could borrow from. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 5

Re: printf "%q" and $'...'

2009-11-25 Thread Andreas Schwab
se read -r -d '' to get really unmangled input.) > but if I try to "output" $'\x00', I can't. $ printf "\x00\n" | cat -A ^@ Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: printf "%q" and $'...'

2009-11-25 Thread Andreas Schwab
Antonio Macchi writes: > but, as you can see, it does not work only for two binary chars The argument space is not suitable for binary I/O. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for s

Re: printf "%q" and $'...'

2009-11-25 Thread Andreas Schwab
Antonio Macchi writes: >> $ printf "\x00\n" | cat -A >> ^@ > > it works, so why... > > $ printf $'\x00' | cat -A > $ > > ... not? The answer is in the part you neglected to read. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key f

Re: Use of pipe in $(< filename | program) returns null

2009-11-28 Thread Andreas Schwab
Bernd Eggink writes: > Am 28.11.2009 06:35, schrieb r...@saturn.syslang.net: >> >> Description: >> use of $(< filename | program) does not work. It either should or it >> should be properly documented. >> The problem also happens on bash4. >> >> Repeat-By: >> >> qq=$(< /etc/pass

Re: IFS handling and read

2009-11-30 Thread Andreas Schwab
"Chris F.A. Johnson" writes: >This works with the output of commands, too: > > IFS=- read year month day <<. > $(date +%Y-%m-%d) > . The disadvantage is that the command is executed synchronously. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fi

Re: best way to test for empty dir?

2009-12-10 Thread Andreas Schwab
Greg Wooledge writes: > It's just a positional-parameter variant of: > > files=("/tmp/emptydir"/*) > if [[ -e ${files[0]} ]] ... This will still fail if the first file happens to be a dangling symlink. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key f

Re: best way to test for empty dir?

2009-12-12 Thread Andreas Schwab
"Matias A. Fonzo" writes: > A solution to check the broken symlink is: > > [ -e "foo" -o -L "foo" -a ! -e "foo" ] In which way is the last check not redundant? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7

Re: best way to test for empty dir?

2009-12-15 Thread Andreas Schwab
sider broken symlinks just >> like anything else. A broken symlink would be a bug in my code and I want to >> detect it ASAP. >> >> >> > Because, if the symlink is not broken, the regular file "exists" ( -e ). >> >> Please forget about corre

Re: best way to test for empty dir?

2009-12-15 Thread Andreas Schwab
"Matias A. Fonzo" writes: > On Tue, 15 Dec 2009 10:37:36 +0100 > Andreas Schwab wrote: > >> "Matias A. Fonzo" writes: >> >> > On Mon, 14 Dec 2009 12:21:12 + >> > Marc Herbert wrote: >> > >> >> Matias A.

Re: Bash-4.1-rc1 available for FTP

2009-12-25 Thread Andreas Schwab
What does that mean? TRACE: pid 17502: mark_dead_jobs_as_notified: ndeadproc (0) != js.c_reaped (14) Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Bash-4.1-rc1 available for FTP

2009-12-26 Thread Andreas Schwab
Chet Ramey writes: > On Dec 25, 2009, at 11:43 AM, Andreas Schwab > wrote: > >> What does that mean? >> > > TRACE: pid 17502: mark_dead_jobs_as_notified: ndeadproc (0) != js.c_reaped > (14) > > It's a debugging/informational message. ndeadproc is a coun

Re: $(pwd) != $(/bin/pwd)

2010-01-05 Thread Andreas Schwab
and which is resolved > relative to your current working directory. > > $PWD is always an absolute pathname. There are two conditions: 1. absolute pathname and 2. to the current directory. The second one is violated. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Error when script uses CRLF line endings w/ if stmt

2010-02-05 Thread Andreas Schwab
Jan Schampera writes: > It's a character like 'A' or 'B'. 'A' and 'B' are letters, $'\r' is whitespace. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: [^/]+ vs. [^/]* - Regular Expression bug?

2010-02-09 Thread Andreas Schwab
home', the second matches nothing. The only difference > is * vs. + AFAICT, both expressions should match 'home'. "[^/]*" matches the null string at the start of '/home/', and there is no reason for the matcher to try another match. Andreas. -- Andreas Schwab

Re: Is there a special variable for the directory where the script is in?

2010-02-12 Thread Andreas Schwab
s a pair of quotes (${link#*"$remove"}). Testcase: 'x[a]' -> 'y'. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Possible Bug in BASH

2010-02-25 Thread Andreas Schwab
the name `c'. Surely they behave differently. Alias substitution is a pure textual substution that changes the text to be parsed. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

cmdhist creates unparsable history entries

2010-03-21 Thread Andreas Schwab
Configuration Information [Automatically generated, do not change]: Machine: powerpc OS: linux-gnu Compiler: gcc -I/usr/src/packages/BUILD/bash-4.1 -L/usr/src/packages/BUILD/bash-4.1/../readline-6.1 Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='powerpc' -DCONF_OSTYPE='linux-gnu' -DCONF_M

Re: [bash-bug] Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Andreas Schwab
l2 > $2 = -1 > > which is strange. Not at all. Overflow invokes undefined behaviour. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: [bash-bug] Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Andreas Schwab
Roman Rakus writes: > But why there is no overflow on 32bit system? Why do you think so? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: How cd to a directory with special characters like environment\<\-?

2010-04-09 Thread Andreas Schwab
t; > As long as we're being exhaustively thorough... > > ... or cd "$_" to reuse the last word of the previous command. > ... or cd !$to reuse the last word in csh-style history expansion. ... or cd M-. (type Meta-period) Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: declare -A a=b crashes bash

2010-04-09 Thread Andreas Schwab
ease >> >> Description: >> Typing 'declare -A a=b' crashes bash with a segmentation fault. >> Repeat-By: >> Type 'declare -A a=b'. > >I can confirm that in 4.0, but it works in 4.1 Not really: $ declare -A a=b; unset a *** glibc detected *** /bin/bash: free(): invalid pointer: 0x10091644 *** Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: declare -A a=b crashes bash

2010-04-09 Thread Andreas Schwab
Andreas Schwab writes: > $ declare -A a=b; unset a > *** glibc detected *** /bin/bash: free(): invalid pointer: 0x10091644 *** And the obvious patch: --- bash-4.1/builtins/declare.def.~1~ 2009-11-26 01:42:00.0 +0100 +++ bash-4.1/builtins/declare.def 2010-04-09

Re: Strange behavior of IFS?

2010-04-15 Thread Andreas Schwab
y the $string was still splitted into words since > it's double quoted. Anyone can give a reasonable explanation? It's not "$string" that was split, but rather $i. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

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...@li

Re: exec status with no command is 0 but no redirection

2010-05-14 Thread Andreas Schwab
ively, enclose the whole script in { ... } and add the pipe after that. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: String corruption using \W in prompt

2010-05-28 Thread Andreas Schwab
   if (t) > - strcpy (t_string, t + 1); > + memmove (t_string, t + 1, sizeof(t)); Surely you want strlen. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Weird behaviour of 'hash' builtin

2010-05-30 Thread Andreas Schwab
Jan Schampera writes: > If this is not a bug, what's the reason behind this? Probably because a command name containing a slash is never looked up on $PATH, thus never remembered and put in the hash table. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 5

Re: =~ no longer working in bash-4.1

2010-06-08 Thread Andreas Schwab
Farkas Levente writes: > hi, > =~ no longer working in bash. just try this little line: > - > if [[ "abc" =~ "abc.*" ]]; then echo inside; else echo outside; fi > - See question E14 in the Bash FAQ.

Re: new features to GNU Bash

2010-06-14 Thread Andreas Schwab
mika.p.maki...@webinfo.fi writes: > user needs to write command mv /home/user/a/b/c/d/e/file > /home/user/a/b/c/d/e/fileB. $ mv /home/user/a/b/c/d/e/{file,fileB} Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED

Re: Bash cannot kill itself?

2010-06-30 Thread Andreas Schwab
; ### END OF THE SCRIPT ### > > It does not work as I expected. The running script was not terminated after > 5 seconds. So what's wrong here? The shell is waiting for foreground process (sleep) to finish. During this time no other process will be started by the shell. Andreas.

Re: Naming convention of bash script filenames

2010-07-12 Thread Andreas Schwab
Bob Proulx writes: > For an executable script I use no suffix at all. It matters not if > the script is a bash script, sh, ksh, perl, ruby, or whatever. Assuming it uses the appropriate shebang. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942

Re: How to run something before invoking the inputted command?

2010-07-12 Thread Andreas Schwab
and1 > $ date; command2 > > Is there an easy way to do that? You can get from the history output, if you set HISTTIMEFORMAT. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: [bash-bug] parsing error with heredoc and command substitution

2010-07-15 Thread Andreas Schwab
"Dr. Werner Fink" writes: > a=$((/bin/cat|wc -l) < a > b > EOF > ) Useless subshell. a=$({ /bin/cat | wc -l; } <

Re: BASH ignores language for command completion

2010-07-15 Thread Andreas Schwab
Chet Ramey writes: > If en_US happens to be the system's default locale, of course. You > can only be sure that you'll get ASCII sorting order if you set > LANG=C. No, you need to set LC_ALL=C, because LANG has the lowest priority. Andreas. -- Andreas Schwab, sch...@lin

Re: function grammar

2010-07-19 Thread Andreas Schwab
Bernd Eggink writes: > "If the function reserved word is supplied, the parentheses are > optional." While the grammer has the right rules for this the handling inside of special_case_tokens isn't right up to it, it only recognizes '{' following 'function

Re: empty lines at the end of quoted command subsitutions missing

2010-07-24 Thread Andreas Schwab
koe...@science-computing.de writes: > empty line(s) at the end of quoted command subsitutions are missing: That is not a bug, but a feature. Command subsitution generally strips trailing newlines from the output of the command. If you want the complete output use a pipe. Andreas. -- Andr

Re: Strange behavior with job control

2010-07-27 Thread Andreas Schwab
ubshell enough time to acutally execute the sleep command. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: RFE? request for an "undefined" attribute for functions

2010-08-02 Thread Andreas Schwab
Bernd Eggink writes: > eval "function $name Don't use function, use "$name ()" instead. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~

2010-08-04 Thread Andreas Schwab
Linda Walsh writes: > I would prefer this work: > > a="h." > > if [[ "hi" =~ "$a" ]]; This works (both with and without compat31): [[ "hi" =~ $a ]] && echo matches (It doesn't matter how you quote the lhs, anyway.) And

Re: The usage of [[ (not with if)

2010-08-04 Thread Andreas Schwab
Bob Proulx writes: > Neither of those produce any output. > > $ printf '%d\n' "" > 0 Since the command substitution is not quoted the result of the expansion is subject to field splitting, thus expands to nothing at all instead of a single empty argument. A

Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~

2010-08-05 Thread Andreas Schwab
Linda Walsh writes: > Or, why should double quotes be functionally the same as single quotes > in that situation? Handling it different from glob meta characters would make it even more special. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942

Re: documentation for ${!prefix*} is misleading

2010-08-10 Thread Andreas Schwab
t matches how $* works), > and that the man page is simply misleading. Parameter expansion and word splitting are two separate steps. The quote above only talks about the former. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: documentation for ${!prefix*} is misleading

2010-08-10 Thread Andreas Schwab
Greg Wooledge writes: > On Tue, Aug 10, 2010 at 04:15:30PM +0200, Andreas Schwab wrote: >> Greg Wooledge writes: >> >> > The 4.1 man page says: >> > >> > ${!prefix*} >> > ${!pre...@} >> >Nam

Re: \c escape within $'...' can produce mangled UTF-8

2010-08-15 Thread Andreas Schwab
Dennis Williamson writes: > It's the responsibility of your code to put an ASCII character after > the \c. There's no way for Bash to guess that the 0xD0 is part of a > Unicode character or the byte that it is. It can, by using mbrlen. Andreas. -- Andreas Schwab, sch...

Re: \c escape within $'...' can produce mangled UTF-8

2010-08-15 Thread Andreas Schwab
Dmitry Groshev writes: > Everything between 0x80 and 0xFF is part of (possibly invalid) > multibyte sequence in UTF-8. Who says that the string is UTF-8 encoded? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED

Re: inconsistent field splitting

2010-08-18 Thread Andreas Schwab
Marc Herbert writes: >for a in $(echo 1 2) ; do echo "x${a}x"; done This applies word splitting on the expansion of $(echo 1 2). > a=$(echo 1 2); echo "x${a}x" This doesn't. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint =

Re: inconsistent field splitting

2010-08-18 Thread Andreas Schwab
se in an assignment. > Quoting makes a difference in some places but no difference in other > places (because of some kind of "implicit quoting"). There is a big difference between $ a=";" and $ a=; Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint =

Re: inconsistent field splitting

2010-08-18 Thread Andreas Schwab
; is a nice feature in programming language > design but extremely low-priority compared to consistency. There is no inconsistency here. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere.

2010-09-17 Thread Andreas Schwab
al meaning of a character. > It is NOT the same as double quotes not allowing *file glob > expansion*. Globbing is not only about expansion, it is also about matching. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: asking for a better way to implement this

2010-09-26 Thread Andreas Schwab
Ken Irving writes: > I'm guessing your $(which rm) is intended to avoid calling rm(), but maybe > \rm > would do the same thing? No, that still calls the function... I'm not sure > how to do that. $ command rm Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG

Re: asking for a better way to implement this

2010-09-28 Thread Andreas Schwab
urprised. :-> syntax error near unexpected token `{su}' Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: higjacking commands

2010-10-01 Thread Andreas Schwab
mmands and > do proper handling (emulate those which are known and give > error if one's still missing). > > Is there any way to do this easily ? Try using the DEBUG trap. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D

Re: difference between "readonly" and "declare -r"

2010-10-13 Thread Andreas Schwab
Cristian Zoicas writes: > a) "readonly" and "declare -r" do not behave the same way; When used in a function, `declare' makes NAMEs local, as with the `local' command. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58

Re: associative array assignment from the output of a function

2010-10-22 Thread Andreas Schwab
..@axel-asus plugins]$ declare -A foo=( $(func) ) $ declare -A foo=('[a]=5') bash: foo: [a]=5: must use subscript when assigning associative array $ eval "declare -A foo=($(echo '[a]=5'))"; echo ${foo[a]} 5 Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint

Re: associative array assignment from the output of a function

2010-10-22 Thread Andreas Schwab
"Chris F.A. Johnson" writes: > On Fri, 22 Oct 2010, Andreas Schwab wrote: > >> Axel writes: >> >>> After your answer, I checked and I think the error message is not >>> related to the variable name collision : >>> >>> [a...@

Expansion from home directory

2005-03-24 Thread Andreas Haselbacher
then this does not happen. Any explanations/ideas/fixes/etc? Thanks Andreas ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash

Re: Expansion from home directory

2005-03-24 Thread Andreas Haselbacher
Hi Chet, I'm afraid I'm not quite sure what you mean. I assume it's installed because partial names are being completed. Also, I forgot to mention that I've encountered this problem on both RH Linux 9.0 and OS 10.3. Andreas Chet Ramey wrote: I apologize if this is old hat

Re: Expansion from home directory

2005-03-25 Thread Andreas Haselbacher
The first command gave output. Does this mean that command-line completion was not active? If yes, how come I could complete paths before? Andreas Chet Ramey wrote: Andreas Haselbacher wrote: Hi Chet, I'm afraid I'm not quite sure what you mean. I assume it's installed becaus

Re: Expansion from home directory

2005-03-25 Thread Andreas Haselbacher
ated to my problem. Andreas Paul Jarc wrote: Andreas Haselbacher <[EMAIL PROTECTED]> wrote: The first command gave output. Does this mean that command-line completion was not active? It means that there were extra completion functions in use, overriding the default completion beha

Re: A possible bug on autocompletion after setting FUNCNEST level

2018-10-08 Thread Andreas Schwab
:~/FOO# vi pr-bash: __reassemble_comp_words_by_ref: maximum function > nesting level exceeded (4) In which way is this a bug? AFAICT, FUNCNEST is doing its job. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: Bash-5.0-beta2 available for download

2018-11-27 Thread Andreas Schwab
arrayfunc.c:valid_array_subscript when you pass VA_NOEXPAND. */ -static char * +static int expr_skipsubscript (vp, cp) char *vp, *cp; { -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: Error on arithmetic evaluation of `~0`.

2018-12-20 Thread Andreas Schwab
t do that either for indexed array subscripts, since they are arithmetic expressions. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: A small documentation suggestion

2019-01-08 Thread Andreas Schwab
On Jan 07 2019, Keith Thompson wrote: > I suggest documenting this behavior. It would be nice to be able to > depend on the exact format, for example that ${EPOCHREALTIME/*./} > is always exactly 6 digits long. ms=${EPOCHREALTIME/*./}00 ms=${ms:0:6} Andreas. -- Andreas Schwab,

Re: Regexp string in := parameter expansion triggers failglob

2019-01-08 Thread Andreas Schwab
fact that := is used is irrelevant. > shell option is enabled, bash-5.0 emits a "no match: " At this point it is a glob pattern, not a regexp. > echo ${TESTPATTERN} If you don't want filename expansion, use quotes. Andreas. -- Andreas Schwab, SUSE Labs, sch.

Re: Difference of extglob between 5.0.0(1)-release and 4.4.23(1)-release

2019-01-13 Thread Andreas Schwab
which > starts with a '.' character. For the same reason `*.' doesn't match `.'. Making `@()' work differently from `*' would be surprising. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: bug: illegal function name?

2019-01-20 Thread Andreas Schwab
On Jan 20 2019, Andrey Butirsky wrote: > |$ unset 1a || > ||bash: unset: `1a': not a valid identifier Use `unset -f'. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for

Re: The use of register keyword in bash source code

2019-02-06 Thread Andreas Schwab
some external devices. No, that is what volatile means. The register keyword is just an optimisation hint, and is mostly ignored by the compiler. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: The use of register keyword in bash source code

2019-02-06 Thread Andreas Schwab
On Feb 06 2019, Peng Yu wrote: > If it is ignored anyway, why "register" is used in many places in the > code? Thanks. Because compilers were dumb in the old days. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D

Re: info missing in output of declare -a in 4.4.x

2019-02-18 Thread Andreas Schwab
fference for me: > > BASH_CMDS > DIRSTACK > GROUPS > > Scalars that exhibit this issue: > > BASHPID > BASH_COMMAND > BASH_SUBSHELL > COMP_WORDBREAKS > HISTCMD > LINENO > RANDOM > SECONDS All these dynamic variables are displayed with values by declare -p after the va

Re: Documentation consistency in the Arrays section

2019-02-21 Thread Andreas Schwab
}. > +declare -A @var{name} > @end example Perhaps it should be reformulated to avoid putting the example at the end of the sentence. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Spelling error in manual x2

2019-02-23 Thread andreas . kahari
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: openbsd6.4 Compiler: cc Compilation CFLAGS: -O2 -pipe -Wno-parentheses -Wno-format-security uname output: OpenBSD eeyore.my.domain 6.4 GENERIC.MP#746 amd64 Machine Type: x86_64-unknown-openbsd6.4 Bash Version:

Re: wait -n shouldn't collect multiple processes

2019-03-26 Thread Andreas Schwab
waits for a single job to terminate" Even better, IMHO: "wait waits for the next job to terminate" Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: "here strings" and tmpfiles

2019-04-11 Thread Andreas Schwab
On Apr 10 2019, Daniel Kahn Gillmor wrote: > data written to the local filesystem can be discovered by someone > analyzing the disk controller data path, or by someone with access to > the underlying storage medium. Do you have swap enabled? Andreas. -- Andreas Schwab, SUSE

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Andreas Schwab
fork looks reasonable, even if only to make it consistent with builtins. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: Backslash mysteriously disappears in command expansion when unescaping would reference an existing file

2019-05-22 Thread Andreas Schwab
do grep -e "$(echo -n "$file" | sed 's/\$/\\$/g')" > someinput; done Use grep -F instead. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: `eval` pollutes the history when it runs "set -o history"

2019-06-11 Thread Andreas Schwab
mands in the history is temporarily suppressed. The > thing is that enabling history with `set -o history' turns all of these > things on. But should the effect of `set -o history' be deferred until the end of the temporary suppression? Andreas. -- Andreas Schwab, SUSE Labs, sch...

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Andreas Schwab
On Jul 12 2019, Chet Ramey wrote: > I assume this means that bc doesn't use strtod. Of course not, strtod doesn't parse arbitrary precision numbers. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1

Re: Combination of "eval set -- ..." and $() command substitution is slow

2019-07-16 Thread Andreas Schwab
t; :123 *: It is not portable, see the autoconf manual: ... is not portable, since not all shells properly understand `"`..."..."...`"', for example Solaris 10 ksh: $ foo="`echo " bar" | sed 's, ,,'`" ksh: : cannot e

Re: Unexpected result of array assignment

2019-07-18 Thread Andreas Schwab
t;]="'"${foo["key"]}"' value2")' This will break if ${foo["key"]} contains any of $ ` " \ . Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: leaks fd for internal functions but not external command

2019-07-23 Thread Andreas Schwab
On Jul 23 2019, Sam Liddicott wrote: > It got closed in the parent. The lsof is running for the parent, the main > process. /bin/echo has quit before the lsof runs. When you run an external command the redirection is performed in the child. Andreas. -- Andreas Schwab, SUSE Lab

Re: [Patch] (tiny problem) bad short_doc for % command

2019-09-21 Thread Andreas Schwab
On Sep 21 2019, "Christopher Chittleborough" wrote: > The command "help -s %" outputs > %: job_spec [&] > when it should output > %: % job_spec [&] > because the $SHORT_DOC for "%" in builtins/reserved.def is wrong. A j

Re: Wrong command option in the manual examples

2019-09-23 Thread Andreas Schwab
o real standard for this - NetBSD has deprecated the -depth > operator (which never really was one) and replaced it by a -d option > which makes much more sense (-depth never really was the right way to > do it). According to https://www.freebsd.org/cgi/man.cgi, find -d already appeared

Re: bash sets O_NONBLOCK on pts

2019-10-02 Thread Andreas Schwab
s different behaviour? Because it's reset immediately before reading the next line with readline. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: Is this a bug by any chance?

2019-10-07 Thread Andreas Schwab
On Okt 07 2019, Greg Wooledge wrote: > x=(1 2 3 4 5 -n '/*' 'hello world') > for z in "${x[@]}"; do > printf %s "$z" > done > echo (IFS=; printf '%s\n' "${x[*]}") Andreas. -- Andreas Schwab, sch...@linux-m68k.org GP

Re: -e test description in the GNU Bash 5.0 man page from 7 December 2018

2019-10-21 Thread Andreas Schwab
t; and this may be surprising from just reading the documentation. It also says: Unless otherwise specified, primaries that operate on files follow sym- bolic links and operate on the target of the link, rather than the link itself. Andreas. -- Andreas Schwab, SUSE Labs,

Re: Feature Request: Custom delimeter for single quotes

2019-11-01 Thread Andreas Schwab
erpolation). As you can see, if the user-specified command > has a single quote, it will break this command unless escaped. Just shell-quote the characters in the interpolated string, as you need to do anyway for the other interpolated strings. Not doing this would be a security bug waiting to

Re: quote removal issues within character class

2019-11-09 Thread Andreas Schwab
eaning within a bracket >> expression. >> > > Is this really what the standard says, because '\\' is not a character, but > 2 characters. They could use "\\" but if a backslash is between single > quotes, it loses its special meaning. This is

Re: Request For Enhancement - TID variable

2019-12-26 Thread Andreas Schwab
On Dez 26 2019, Eric S. Raymond wrote: > RFE: bash should have a TID varuable that returns the vakue of gettid(2). Bash doesn't use threads, so $TID will always be the same as $BASHPID. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 0

Re: Filename Expansion bug

2020-01-09 Thread Andreas Schwab
it points to. But filename expansion is not operating on literal strings, it is operating on existing filesystem objects. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: Command substitution before while loop

2020-04-01 Thread Andreas Schwab
ved words are only recognized at the start of a command, before any expansions. For the same reason a compound command cannot be preceded by redirections. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now

Re: Proposed new feature for bash: unbuffered pipes

2020-04-23 Thread Andreas Schwab
See stdbuf(1). Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: How functions are defined

2020-04-28 Thread Andreas Schwab
laced by "the > first word of a command (see SHELL GRAMMAR below)", which helps. Isn't (4) also a subset of (1)? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: Bash-5.1-alpha available for download

2020-06-17 Thread Andreas Schwab
kefile:326: installdirs-data-yes] Error 127 Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: ‘command … &’ creates subshell

2020-07-01 Thread Andreas Schwab
e 126. And that's what bash does. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: (IMPORTANT/URGENT) Regarding Missing Files in bash source code?

2020-07-17 Thread Andreas Schwab
On Jul 17 2020, Chet Ramey wrote: > So Greg's advice is appropriate: find out why bison is looking for that > file, It is one of its installed files used during runtime. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E78

Re: No word splitting for assignment-like expressions in compound assignment

2020-07-27 Thread Andreas Schwab
On Jul 27 2020, Lawrence Velázquez wrote: > If word splitting were not performed in compound assignments, this... > > foo=(a b c) > > ...would not work. This is not true. Field splitting is only relevant for words generated by other expansions, not for literal tokens. Andrea

Re: Bash-5.1-beta available

2020-09-11 Thread Andreas Schwab
<(filter) The reason for using a process substitution is so that the loop can set shell variables. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

<    1   2   3   4   5   6   7   8   9   >