Problems applying patches

2008-11-18 Thread Dan
Apologies if this is all "basic" or "dumb" and I hope this is the correct mailing list. Also, I tried posting this before but it doesn't appear to have worked, so I'm trying again. Apologies for any duplication. I'm a bit of newbie when it comes to patching Linux software, and I have been ha

Re: Problems applying patches

2008-11-18 Thread Dan
Thank you very much for the fast reply. Stephane Chazelas wrote: I'm not sure why you need to do all that. Here, I do: [...] Maybe you've got too old a version of the "patch" utility. Here, patch --version gives me: patch 2.5.9 [...] Well, I have this exact same version of the patch progr

Re: Problems applying patches

2008-11-19 Thread Dan
In general, I don't use those systems, but I ran something similar to for f in $(seq -w 01 33); do patch -p0 < /path/to/patches/bash32-0$f; done on RHE3 without errors, compiled that version, ran for f in $(seq -w 34 39); do patch -p0 < /path/to/patches/bash32-0$f; done and ran `make' again.

Re: Problems applying patches

2008-11-20 Thread Dan
27;s going on there now. "make test" fails some of the tests at patch level 39 and patch level 48. I'll investigate a bit more as I've only tried it on one of my Linux systems and post details if I can't work out what the problem is. Dan

Re: Problems applying patches

2008-11-20 Thread Dan
"make test" fails some of the tests at patch level 39 and patch level 48. I'll investigate a bit more as I've only tried it on one of my Linux systems and post details if I can't work out what the problem is. Dan So I tried building it on Fedora 9 and it built wit

Show slash if a directory upon TAB

2022-11-11 Thread Dan Jacobson
$ pdf pdf pdf2ps pdfcrack pdffonts pdfinfo pdfsig pdftocairo pdftoppm pdftotext pdf2dsc pdfattach pdfdetach pdfimages pdfseparate pdftexi2dvi pdftohtml pdftops pdfunite What's this, a new command called "pdf". I must try it! $ pdf bash: pdf: command not found $ ls -d pdf pdf Oh, all along it was

Bug: Subshell won't continue after .-sourcing a file

2022-12-21 Thread Dan Church
' >"$sub1" echo 'echo "2nd script starting" && ${THIS_SH} '"$sub3" >"$sub2" echo 'echo "3rd script starting"' >"$sub3" . "$sub1" "1st script still executing" will nev

Re: Bug: Subshell won't continue after .-sourcing a file

2022-12-22 Thread Dan Church
. "$sub1" Turns out the best time to find bugs in your code is when demoing it for someone else. :-) On 12/22/22 11:18 AM, Chet Ramey wrote: On 12/21/22 11:44 PM, Oğuz wrote: 22 Aralık 2022 Perşembe tarihinde Dan Church yazdı: Repro:     sub1=$(mktemp)     sub2=$(mktemp)     su

Junk at the end on history

2023-04-04 Thread Dan Jacobson
$ history works fine if I pipe it into tail. But if I just let it pour out on the screen, I get this junk after it sitting at the prompt: 9997 Tue, 04 Apr 2023 17:31:36 +0800 history 9998 Tue, 04 Apr 2023 17:31:59 +0800 history |tail Tue, 04 Apr 2023 17:32:06 +0800 history $ 64;1;2;6;9;1

Re: Junk at the end on history

2023-04-04 Thread Dan Jacobson
There probably was. Say, there should be a way to protect the user against something like that. I wish I could just tell it to only allow utf-8 in my history.

Re: Junk at the end on history

2023-04-06 Thread Dan Jacobson
Sorry everybody. I cannot reproduce it. Nor is anything wrong with the HISTFILEs... It must of had something to do with me exploring many "i3" windows configurations that day.

Document m=1 m=2; echo $m result

2023-07-02 Thread Dan Jacobson
man page says: A variable may be assigned to by a statement of the form name=[value] If value is not given, the variable is assigned the null string. All values undergo tilde expansion, parameter and variable expansion... OK, but do please mention s

Re: Document m=1 m=2; echo $m result

2023-07-02 Thread Dan Jacobson
> "LV" == Lawrence Velázquez writes: LV> This is stated under "Simple Command Expansion". OK good. No more issue.

set -x vs. n=($@)

2023-09-03 Thread Dan Jacobson
It's not fair: set -x a b c m=$@ n=($@) == gives == + m='a b c' + n=($@) please either say + m=$@ + n=($@) or better: + m='a b c' + n=('a' 'b' 'c') or metion on https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html the special exception. GNU bash, version 5.2.15

Warn upon "declare -ax"

2023-09-04 Thread Dan Jacobson
Shouldn't "declare -ax" print a warning that it is useless?

Re: set -x vs. n=($@)

2023-09-06 Thread Dan Jacobson
m=$@; n=($@)' + m='a b c' + n=($@) ) >>>>> "CR" == Chet Ramey writes: CR> On 9/3/23 6:08 AM, Dan Jacobson wrote: >> It's not fair: >> set -x a b c >> m=$@ n=($@) >> == gives == >> + m='a b c' >> + n=($@)

Regex: A case where the longest match isn't being found

2023-10-26 Thread Dan Bornstein
Configuration Information [Automatically generated, do not change]: Machine: aarch64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -O2 -ftree-vectorize -flto=auto -ffat-lto-objects -fexcepti\ ons -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY\ _SOURCE=2 -Wp,-D_GLIBCXX

Re: Regex: A case where the longest match isn't being found

2023-10-26 Thread Dan Bornstein
depends more on the regex library that Bash got linked with than anything that Bash inherently does. Thanks again, and sorry for the noise. -dan On Thu, Oct 26, 2023, at 10:50 AM, Dan Bornstein wrote: > Configuration Information [Automatically generated, do not change]: > Machine: aarch64

Make reverse-i-search failure joltingly clear

2023-12-10 Thread Dan Jacobson
Type ^R and some string, At the point while we are typing that the search fails, all that happens is the word "failed" gets added at front, (reverse-i-search)`nni': set jida^Ci.org/geo/house_numbering/grids/us/il/lake/lake_county/ (failed reverse-i-search)`nnii': set jida^Ci.org/geo/house_number

Re: Make reverse-i-search failure joltingly clear

2023-12-12 Thread Dan Jacobson
Well these days the chances of bells, visual or audible, getting through are less and less, e.g., https://github.com/alacritty/alacritty/issues/1528 and on chromebook one must turn the bell on, etc. So I still think something different should happen than each forlorn character just mounting up on

Add example of bind readline-command-line

2023-12-12 Thread Dan Jacobson
bash man page says -v Display readline variable names and values in such a way that they can be re-read. Perhaps add an example of rereading via the bind command: $ bind 'set bell-style visible' else the user might try: $ echo set bell-style visible|bind Yes,

Add option to just print history, with no added timestamps or line numbers

2024-03-23 Thread Dan Jacobson
$ help history should mention how in the world one is supposed to just print the plain history, without any line numbers or time stamps. You might say, "Just strip it off with perl or sed." Well, fine. Then mention that in help history. Currently one needs massive superfund environmental clean-u

Re: Add option to just print history, with no added timestamps or line numbers

2024-03-24 Thread Dan Jacobson
> "MDK" == Martin D Kealey writes: MDK> How about « fc -ln » ? I like it! P.S., $ help fc -nomit line numbers when listing Yes, it omits the line numbers. But leaves the "^I " separators! $ fc -l 999 1000|cat -vt 999^I echo invite Nerbleson for dinner 1000^I echo and Snordsw

Re: Add option to just print history, with no added timestamps or line numbers

2024-03-24 Thread Dan Jacobson
How unfortunate. P.S., "\t%s" seems to have an extra space squeezed between them with bash: "\t %s", unless perhaps the spec says that %s always starts with a space.

Re: Add option to just print history, with no added timestamps or line numbers

2024-03-24 Thread Dan Jacobson
Hmm, so no matter POSIX mode or not, both will be dragging around that little piece of toilet paper stuck to their shoes (\t)... unless some new option is invented.

Re: libtool 2.4 args parsing incredibly slow

2011-01-31 Thread Dan McGee
On Sat, Jan 29, 2011 at 5:58 PM, Chet Ramey wrote: > On 1/25/11 10:08 PM, Peter O'Gorman wrote: >> Hi, >> >> Dan reported a libtool performance regression in libtool-2.4 when running >> his binaries with a large number of arguments. >> >> Libtool create

List of background processes in a command group, in a pipeline, executed sequentially under certain conditions.

2011-10-01 Thread Dan Douglas
GE='bash' -DSHELL - DHAVE_CONFIG_H -I. -I. -I./include -I./lib - DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' -DSTANDARD_UTILS_PATH='/bin:/usr/bin:/sbin:/usr/sbin' - DSYS_BASHRC='/etc/bash/bashrc' -DSYS_BASH_LOGOUT

[bug] Command substitutions within C-style for loops. Semicolon causes error.

2011-10-28 Thread Dan Douglas
x error: `(( i = j = k = 1; i % 9 || (j *= -1, $( ((i%9)) || printf " " >&2; echo 0), k++ <= 10); i += j ))' Segmentation fault The segfault on the subshell there is a bit odd if it were merely a syntax error. GNU bash, version 4.2.10(1)-release (x86_64-pc-linux-gnu) -Dan Douglas

Re: problem with tail -f that need to add to each line constant string at the beginning of each line

2011-10-30 Thread dan sas
Hi what about if i want to run both commands simultaneous and send the output to a file how can i do that 2011/10/29 Bob Proulx > dan12341234 wrote: > > im running 4 scripts that perform ssh and tail -f on a file exist on 4 > > servers and display on the screen. > > (1 script per servers) > >

Re: lseek with bash

2011-12-11 Thread Dan Douglas
sic I/O isn't something I like to repeatedly fork little external processes to achieve. The zsh MULTIOS concept is interesting to that end but probably a bit over-the-top for Bash. Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: Print non-readonly variables with declare +r -p

2011-12-13 Thread Dan Douglas
On Tuesday, December 13, 2011 12:14:41 PM lhun...@mbillemo.lin-k.net 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='d

Re: Print non-readonly variables with declare +r -p

2011-12-14 Thread Dan Douglas
On Wednesday, December 14, 2011 10:57:21 AM Chet Ramey wrote: > On 12/13/11 3:13 PM, Dan Douglas wrote: > > I imagine this is ok because Bash's declare -p is intended to be human- > > readable only, whereas Ksh guarantees -p produces output in a format > > reusable as i

Re: Ill positioned 'until' keyword

2011-12-14 Thread Dan Douglas
On Wednesday, December 14, 2011 05:47:24 PM Peng Yu wrote: > Hi, > > I looks a little wired why 'until' is the way it is now. According to > the manual until is before the do-done block. > > until test-commands; do consequent-commands; done > > A common design of until in other language is that

segfault expanding certain arrays created via read -N directly to an array.

2011-12-19 Thread Dan Douglas
ll = invert = 0 ignore_return = 0 was_error_trap = my_undo_list = 0x0 exec_undo_list = 0x0 last_pid = save_line_number = #14 0x0046d7b3 in parse_and_execute (string=, from_file=, flags=) at evalstring.c:319 bitmap = 0x6f5920 code = 0 lreset = should_jump_to_top_level = 0 last_result = 0 command = 0x6f58f0 #15 0x0041d399 in run_one_command (command=) at shell.c:1315 code = 0 #16 0x0041c2c6 in main (argc=3, argv=0x7fffd448, env=0x7fffd468) at shell.c:688 i = code = old_errexit_flag = 0 saverst = 0 locally_skip_execution = 0 arg_index = 3 top_level_arg_index = 3 -- Dan Douglas signature.asc Description: This is a digitally signed message part.

[bug] Bash translates >&$var into &>$var for exported functions.

2012-01-22 Thread Dan Douglas
rt -f f + export -pf f () { echo 'hi' } &>${1} declare -fx f * PS4='* ' * BASH_XTRACEFD=4 + bash -xc 'f 3; cat' * f 3 * echo hi * cat + [[ -f 3 ]] + cat ./3 hi END OUTPUT Bash v. 4.2 w/ patchset 20 on Gentoo Linux amd64. -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: bash blocking on exec assigning an output file descriptor to a fifo

2012-02-14 Thread Dan Douglas
O_NONBLOCK is up there in things I wouldn't mind using. Namely, having access to errno. I don't see any way of determining the "fullness" of a buffer even through /proc/self/fdinfo/ on Linux. -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: excess braces ignored: bug or feature ?

2012-02-17 Thread Dan Douglas
On Friday, February 17, 2012 02:51:27 PM Mike Frysinger wrote: > can't tell if this is a bug or a feature. > > FOO= BAR=bar > > : ${FOO:=${BAR} > > echo $FOO > > i'd expect an error, or FOO to contain those excess braces. instead, FOO is > just "bar". >

Re: excess braces ignored: bug or feature ?

2012-02-19 Thread Dan Douglas
On Sunday, February 19, 2012 04:25:46 PM Chet Ramey wrote: > On 2/17/12 6:22 PM, Dan Douglas wrote: > > My favorite is probably the parser ignoring any valid redirection syntax > > with the special command substitutions. > > > > ~ $ { echo "$({xx

Re: excess braces ignored: bug or feature ?

2012-02-20 Thread Dan Douglas
2 ~ $ : | { { echo $BASH_SUBSHELL >&2; } } | : 1 -- Dan Douglas

Re: shopt can't set extglob in a sub-shell?

2012-02-26 Thread Dan Douglas
shopt -s extglob echo !(x) ) f fi f I was thinking there might be a general solution via the RETURN trap where you could just set "trace" on functions where you want it, but looks like even "redefinitions"

Re: Pathname expansion not performed in Here Documents

2012-02-26 Thread Dan Douglas
n. "If word is unquoted, all lines of the here-document are subjected to parameter expansion, command substitution, and arithmetic expansion." No pathname expansion. -- Dan Douglas

Re: Pathname expansion not performed in Here Documents

2012-02-27 Thread Dan Douglas
On Monday, February 27, 2012 02:07:25 PM Davide Baldini wrote: > FROM Davide Baldini > > On 02/27/12 04:11, Dan Douglas wrote: > > "If word is unquoted, all lines of the here-document are subjected to > > parameter expansion, command substitution, and arithmetic expans

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

2012-02-28 Thread Dan Douglas
t;> quote) when you want to not perform word splitting. I would consider > >> it > >> as a bug. > > > > imadev:~$ q=\' > > imadev:~$ input="foosomethingbar" > > imadev:~$ echo "${input//something/$q}" > > foo'bar > &g

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

2012-02-28 Thread Dan Douglas
On Tuesday, February 28, 2012 06:38:22 PM John Kearney wrote: > On 02/28/2012 06:31 PM, Dan Douglas wrote: > > On Tuesday, February 28, 2012 05:53:32 PM Roman Rakus wrote: > >> On 02/28/2012 05:49 PM, Greg Wooledge wrote: > >>> On Tue, Feb 28, 2012 at 05:36

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

2012-02-28 Thread Dan Douglas
On Tuesday, February 28, 2012 06:52:13 PM John Kearney wrote: > On 02/28/2012 06:43 PM, Dan Douglas wrote: > > On Tuesday, February 28, 2012 06:38:22 PM John Kearney wrote: > >> On 02/28/2012 06:31 PM, Dan Douglas wrote: > >>> On Tuesday, February 28, 2012 05:53:32 P

Brace expansion bug

2012-03-26 Thread Dan Douglas
b c' 'a b c' 'a b c' a b c a b c a b c I'm told similar glitches have been found before. Looks like this applies to anything that has this sort of replacement context that contains valid brace expansion syntax inside quotes. Bash 4.2.24 - Gentoo amd64 -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: Brace expansion bug

2012-03-26 Thread Dan Douglas
On Monday, March 26, 2012 01:44:58 PM you wrote: > Dan Douglas writes: > > Hi, hopefully a self-explanatory one today: > > ~ $ ( set -x -- {a..c}; echo "${*-"{1..3}"}" ) > > + echo 'a b c' 'a b c' 'a b c' > >

Re: Brace expansion bug

2012-03-26 Thread Dan Douglas
On Monday, March 26, 2012 08:07:00 AM you wrote: > On 03/26/2012 07:56 AM, Dan Douglas wrote: > > Don't know how much I'm allowed to quote here, but a quick read of the > > POSIX parsing rules and parameter expansion sections suggest to me that > > the start of th

Exit status of "if" statement?

2012-04-09 Thread Dan Stromberg
What should be the behavior of the following? if cmd1 then cmd2 fi && if cmd3 then cmd4 fi I've not joined two if's with a short-circuit boolean before, but I'm suddenly working on a script where someone else has. Playing around, it appears that cmd1 and cmd3 have no direct impact on the

Re: Passing variables by reference conflicts with local

2012-04-30 Thread Dan Douglas
led explaination and example here: http://wiki.bash-hackers.org/commands/builtin/unset#scope Hopefully most of that is correct. -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Segfault on compound assignment to a variable whose name is set in the environment of a declaration builtin.

2012-05-18 Thread Dan Douglas
old_errexit_flag = 0 saverst = 0 locally_skip_execution = 0 arg_index = 3 top_level_arg_index = 3 (gdb) q $ echo $BASH_VERSION 4.2.28(1)-release Thanks again. (not overly anxious for a fix.) -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: quoted and concatenated positional parameters

2012-05-23 Thread Dan Douglas
<2> <3> <4> <5foo> <1 2 3 4 51> <1 2 3 4 5foo> dash: <1> <2> <3> <4> <51> <1> <2> <3> <4> <5foo> <1> <2> <3> <4> <51> <1> <2> <3> <4> <5foo> <123451> <12345foo> bash: <1 2 3 4 51> <1> <2> <3> <4> <5foo> <1> <2> <3> <4> <51> <1> <2> <3> <4> <5foo> <1 2 3 4 51> <1> <2> <3> <4> <5foo> zsh: <1> <2> <3> <4> <51> <1> <2> <3> <4> <5foo> <1> <2> <3> <4> <51> <1> <2> <3> <4> <5foo> <1> <2> <3> <4> <51> <1> <2> <3> <4> <5foo> -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: quoted and concatenated positional parameters

2012-05-23 Thread Dan Douglas
Ugh, Sorry, I forgot to strip trailing whitespace. If that wasn't comprehensible for anyone, the heredoc in the preceeding the testcase was: args() { printf '<%s> ' "$@"; echo; } args "${@}${1}" args "${@}foo" args ${@}${1} args ${@}foo IFS= args ${@}${1} args ${@}foo EOF -- Dan Douglas

Re: handling of test == by BASH's POSIX mode

2012-05-27 Thread Dan Douglas
statically anyway. Any such lint tool is limited to lexical analysis which makes it not very useful for testing unless your script is perfectly free of side-efffects. And who writes side-effect free shell scripts? How would the shell check for the correctness of: "$(rm -rf somepath; echo '[')" x == x ] -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: handling of test == by BASH's POSIX mode

2012-05-27 Thread Dan Douglas
h-0.5.7.1 Total files : 73 Total size : 1.14 MiB # equery s mksh * app-shells/mksh- Total files : 39 Total size : 1.61 MiB # equery s bash * app-shells/bash-4.2_p28 Total files : 464 Total size : 6.33 MiB -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: Compare 2 arrays.

2012-05-30 Thread Dan Douglas
On Wed, May 30, 2012 at 4:57 PM, Greg Wooledge wrote: > > On Wed, May 30, 2012 at 10:14:42AM -0600, Bill Gradwohl wrote: > > What say you Chet? Bug or feature? There is no middle ground. > > That's unrealistic.  There are plenty of things that occupy that middle > ground -- unexpected program beha

Re: Indirect access to variables, including arrays (was Re: Compare 2 arrays.)

2012-06-07 Thread Dan Douglas
hink of whatever sucks the least. Granted, these are atypical issues. I care about this more than most due to Gentoo being stuck with Bash and eclasses being among the few valid reasons to care about large safe extensible libraries written for a shell. -- Dan Douglas

mapfile -n seeks ahead an extra line

2012-06-20 Thread Dan Douglas
From: Dan Douglas To: bug-bash@gnu.org Subject: mapfile -n seeks ahead an extra line Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: x86_64-pc-linux-gnu-gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64&

Re: Doc of "set -e" should mention non-locality

2012-06-29 Thread Dan Douglas
On Thursday, June 28, 2012 02:37:17 PM Rainer Blome wrote: > The implementation of "set -e" does not respect "lexical nesting". > This can be very surprising. None of the "set" options do, nor does the ERR trap. That would make this the exception. Here's a workaround (untested). sete() { [

Re: Doc of "set -e" should mention non-locality

2012-07-05 Thread Dan Douglas
On Wednesday, July 04, 2012 05:37:25 PM Rainer Blome wrote: > Original-Nachricht > > Datum: Fri, 29 Jun 2012 18:03:13 -0500 > > Von: Dan Douglas > > An: bug-bash@gnu.org > > CC: Rainer Blome > > Remember that my main suggestion is to clearly

Re: why must non-standard $IFS members be treated so differently ?

2012-07-29 Thread Dan Douglas
%s> ' "${v[@]}"; echo; }; f 1:2:3\:4 <1> <2> <3> <4> $ f() { IFS=: local -a 'v=( $@ )'; printf '<%s> ' "${v[@]}"; echo; }; f 1:2:3\\:4 <1> <2> <3\> <4> See also my answer to this recent question: http://superuser.com/a/454564/78905 -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: why must non-standard $IFS members be treated so differently ?

2012-07-29 Thread Dan Douglas
#x27; and not `${#@}', and also that you did not set IFS=: for count_args? If you use exactly the function you sent with the default IFS then you should get 4 here. -- Dan Douglas signature.asc Description: This is a digitally signed message part.

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

2012-08-18 Thread Dan Douglas
analagous behaviors for `+=' and the integer attribute. $ set -x; a=( [1]=* ) + a=([1]=*) -- Dan Douglas

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

2012-08-18 Thread Dan Douglas
On Saturday, August 18, 2012 07:55:17 PM Stephane Chazelas wrote: > 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 > &g

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

2012-08-18 Thread Dan Douglas
Bleh I'm wrong, brace expansion remains too. I should know this... it's hard to remember all the quirks even when I write them down.

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

2012-08-20 Thread Dan Douglas
icitly. I like that Bash can just implicitly start counting at any index. -- Dan Douglas

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

2012-08-21 Thread Dan Douglas
ounds. The current behavior doesn't make sense. Still, a variable/function attribute for disabling pathname expansion in a controled manner would be useful given that having to manage the state of set -f mostly precludes its use. -- Dan Douglas

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

2012-08-29 Thread Dan Douglas
nsion are ugly: $ declare -a 'a+=(['{0..3}']=foo)' b[{0..3}]=foo c=( [{0..3}]=foo ) $ declare -a "c=(${c[*]})" $ declare -p a b c declare -a a='([0]="foo" [1]="foo" [2]="foo" [3]="foo")' ... -- Dan Douglas

Some issues with short-circuiting arithmetic operators

2012-09-05 Thread Dan Douglas
# max depth == 1024 bash: n: expression recursion level exceeded (error token is "n") $ bash -c 'n=0 a="(a[n]=n++)<7&&a"; ((a)); echo "${a[@]:1}"' bash: (a[n]=n++)<7&&a: expression recursion level exceeded (error token is

Re: "break" inside a while-condition

2012-09-11 Thread Dan Douglas
ding the "do" keyword is considered part of the loop. The same applies to "continue". -- Dan Douglas

Re: Parsing error when "case" in "for" in $()

2012-09-11 Thread Dan Douglas
z,{,m}k}sh bb ) while IFS= read -r testCase; do printf '%s\nfails: ' "$testCase" for sh in "${shells[@]}"; do "$sh" -c "$testCase" 2>/dev/null || printf '%s ' "$sh" done echo $'\n' done <<"EOF" : $(case . in .) :; esac) : $(case . in (.) :; esac) : $({ case . in .) :; esac; }) : "$({ case . in .) :; esac; })" : $(for x in .; do case . in .) :; esac; done) : "$(for x in .; do case . in .) :; esac; done)" EOF -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: a recursion bug

2012-10-04 Thread Dan Douglas
t; There's not actually anything you can do about that except use ulimit to > get as much stack space as you can. Well, poor-mans TCO f() if [ "$1" -ge 0 ]; then printf "$1 " exec dash -c "${2}f "'$(($1-1)) "$2"' -- "$@" fi ( f 100 "$(typeset -f f)"$'\n' ) Joking of course :o) FUNCNEST is usually good enough for me. No other shell I'm aware of even has that. -- Dan Douglas

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-14 Thread Dan Douglas
y allow things like: $ mksh -c ': | ! : | :; echo $? "( ${PIPESTATUS[@]} )"' 1 ( 0 1 ) $ mksh -c ': | ! { ! : | :; }; echo $? "( ${PIPESTATUS[@]} )"' 0 ( 0 0 ) I don't believe this is valid syntax, but also end up being pipelines of two elements. Bash, dash, zsh, etc don't accept this. -- Dan Douglas

bug-bash@gnu.org

2012-10-15 Thread Dan Douglas
t;-"EOF" >&2 Error: Braindamage detected. Protecting your system. EOF esac -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-15 Thread Dan Douglas
; though. Bash interestingly accepts "! !cmd" and "{ ! !; }; cmd", but not "! !; cmd". Also I may as well overload this mail by reporting that nearly every issue I've ever sent to this list over the last year or so (that turned out being "legitimate") appears to have been addressed in devel (at least, according to a few minutes of testing). Thanks! :) -- Dan Douglas

Re: [ast-users] [ksh93] Should ~$user be tilde expanded?

2012-10-25 Thread Dan Douglas
rated by the more common behavior. -- Dan Douglas

Re: wait unblocks before signals processed

2012-11-05 Thread Dan Douglas
l fire when any child exits including command/process substitutions or pipelines etc. If any are located within the main loop then monitor mode needs to be toggled off around them. -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: wait unblocks before signals processed

2012-11-05 Thread Dan Douglas
ible for the count to become off. See: https://lists.gnu.org/archive/html/bug-bash/2012-05/msg00055.html I think you might be experiencing other known bugs. Chet pushed several wait/job related commits within the last few weeks. I haven't tested these yet. http://git.savannah.gnu.org/cgit/bas

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

2012-11-14 Thread Dan Douglas
sh is equivalent to the date(1) default for the current locale. So, LC_TIME=C; [[ $(printf '%()T') == "$(date)" ]] is true. I imagine all the functionality ksh gets basically for free with libast tm.h functions is totally out of the question, if all there is to work from is libc strptime and friends. Having "date -d" essentially built in is handy. :/ -- Dan Douglas

Re: fd leak with {fd}>

2012-11-30 Thread Dan Douglas
On Monday, November 26, 2012 11:57:33 AM Chet Ramey wrote: > On 11/26/12 8:41 AM, Pierre Gaston wrote: > > On Mon, Nov 26, 2012 at 3:37 PM, Chet Ramey > > wrote: > > > > On 11/23/12 2:04 AM, Pierre Gaston wrote: > > > It seems rather counter intuitive that the fd is no

Re: "And" extended matching operator

2012-12-03 Thread Dan Douglas
ntax, which would be a huge undertaking. -- Dan Douglas

Re: Why can't I say "&>&3"? Bug or feature?

2012-12-06 Thread Dan Douglas
on't like &> to begin with. It makes the already cryptic redirection syntax that beginners struggle to understand even more confusing by adding a pointless shortcut with a non-obvious meaning instead of just being explicit. If you don't understand the copy descriptor and all of a sudden see yet another use for the & character to the left of a redirection operator, you're going to be even more confused. -- Dan Douglas

Requesting an alternate nameref feature

2012-12-12 Thread Dan Douglas
be passed through the positional parameters as in ksh. This feature would have similarities to "declare -g" in its ability to tunnel around overloaded variable names in outer scopes, except would allow both reading and writing to any scope from any deeper scope (provided the reference itself hasn't been covered up). This would be extremely useful for shell libraries. -- Dan Douglas

Re: shouldn't /+(??) capture 2 letter files only?

2012-12-13 Thread Dan Douglas
tiples of that length. $ ksh -c 'printf %R\\n \?' ^.$ $ ksh -c 'printf %R\\n "+(?)"' ^(.)+$ $ ksh -c 'printf %R\\n "+(??)"' ^(..)+$ -- Dan Douglas

Re: shouldn't /+(??) capture 2 letter files only?

2012-12-13 Thread Dan Douglas
On Thursday, December 13, 2012 09:25:02 PM DJ Mills wrote: > +(???) matches lengths that are multiples of 3, not all odd-length files. > ?+(??) would match odd-length files. My bad :) -- Dan Douglas

Re: Question about the return value of 'local'

2012-12-14 Thread Dan Douglas
ined types are self- documenting). Most shell manuals follow about the same overall format and obviously borrow from one another. Some paragraphs are word-for-word identical between Bash and multiple other manuals. Best bet is to learn to navigate it quickly. -- Dan Douglas

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

2012-12-14 Thread Dan Douglas
extra c or s conversion specifiers shall be evaluated as if a null > string argument were supplied; other extra conversion specifications > shall be evaluated as if a zero argument were supplied. Ooh ok... hrm I didn't consider it's actually consistent with everything else this way. -- Dan Douglas

Some segfaults possible via mapfile callbacks

2013-01-09 Thread Dan Douglas
unset -v x; :" a' + typeset -n x=a + mapfile -tc1 -C 'unset -v x; :' a ++ unset -v x ++ : 0 a Segmentation fault There were others, mostly to do with modifying the variable being mapped. -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Reverse redirection / assignment order

2013-01-09 Thread Dan Douglas
21 21 # bash posix mode bash: 21 21 21 # normal mode ksh : 21 21 12 # ksh93 is the other oddball shell dash: 12 12 12 # ... ...# Everything else same as dash I don't know why this order was chosen or what the advantages to one over the other might be. -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Short list of issues with various expansions and IFS

2013-01-09 Thread Dan Douglas
_filename is false bypasses a huge chunk that I haven't looked at closely. diff --git a/redir.c b/redir.c index 921be8c..f248fd7 100644 --- a/redir.c +++ b/redir.c @@ -153,7 +153,7 @@ redirection_error (temp, error) } } #endif - else if (expandable_redirection_filename (temp)) + else if (0) { expandable_filename: if (posixly_correct && interactive_shell == 0) -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: Segmentation fault in arithmetical expression when mixing array variables.

2013-01-09 Thread Dan Douglas
in an expression where the first refers to an array index. $ ( y=(1 2); (( _ = y, _ = 1 )) )# No error $ ( y=(1 2); (( _ = y[0], _ = 1 )) ) # crash Segmentation fault $ ( y=(1 2); (( _ = y[0] )) ) # No error lvalue doesn't matter. It's just any two assignments in which the first dereferences an array with an index given. -- Dan Douglas

Assignment errors with no additional words expanded in non-POSIX mode fails to abort

2013-01-11 Thread Dan Douglas
x27; 2>&1 pre bash: line 1: 8#9: value too great for base (error token is "8#9") post Only applies to non-POSIX mode. -- Dan Douglas signature.asc Description: This is a digitally signed message part.

typeset -p on an empty integer variable is an error. (plus -v test w/ array elements)

2013-01-11 Thread Dan Douglas
ks in ksh to test if an individual element is set, though it hasn't always. Maybe Bash should do the same? -v is tricky because it adds some extra nuances to what it means for something to be defined... -- Dan Douglas signature.asc Description: This is a digitally signed message part.

printf %q represents null argument as empty string.

2013-01-11 Thread Dan Douglas
', even mksh's ${var@Q} expansion. Zsh's ${(q)var} does. -- Dan Douglas signature.asc Description: This is a digitally signed message part.

Re: printf %q represents null argument as empty string.

2013-01-11 Thread Dan Douglas
On Friday, January 11, 2013 09:39:00 PM John Kearney wrote: > Am 11.01.2013 19:38, schrieb Dan Douglas: > > $ set --; printf %q\\n "$@" > > '' > > > > printf should perhaps only output '' when there is actually a corresponding >

Re: typeset -p on an empty integer variable is an error. (plus -v test w/ array elements)

2013-01-11 Thread Dan Douglas
On Friday, January 11, 2013 09:48:32 PM John Kearney wrote: > Am 11.01.2013 19:27, schrieb Dan Douglas: > > Bash treats the variable as essentially undefined until given at least an > > empty value. > > > > $ bash -c 'typeset -i x; [[ -v x ]]; echo "$

Re: printf %q represents null argument as empty string.

2013-01-11 Thread Dan Douglas
On Friday, January 11, 2013 04:37:56 PM Chet Ramey wrote: > On 1/11/13 4:05 PM, Dan Douglas wrote: > > > > > I don't understand what you mean. The issue I'm speaking of is that printf > > %q > > produces a quoted empty string both when given no args and

Re: printf %q represents null argument as empty string.

2013-01-11 Thread Dan Douglas
r zero argument if more formats than arguments are given. We already had pretty much this same discussion here: http://lists.gnu.org/archive/html/bug-bash/2012-12/msg00083.html It somehow slipped my mind. -- Dan Douglas

Re: typeset -p on an empty integer variable is an error. (plus -v test w/ array elements)

2013-01-12 Thread Dan Douglas
Yes some use -u / -e for debugging apparently. Actual logic relying upon those can be fragile of course. I prefer when things return nonzero instead of throwing errors usually so that they're handleable. -- Dan Douglas

Re: printf %q represents null argument as empty string.

2013-01-12 Thread Dan Douglas
On Friday, January 11, 2013 10:39:19 PM Dan Douglas wrote: > On Saturday, January 12, 2013 02:35:34 AM John Kearney wrote: > BTW, your wrappers won't work. A wrapper would need to implement format Hrmf I should have clarified that I only meant A complete printf wrapper would be d

  1   2   3   4   5   >