Re: Opening a `.HFS+ Private Directory Data'$'\r` folder messes up terminal prepended prompt

2020-02-08 Thread Lawrence Velázquez
> On Feb 7, 2020, at 9:06 AM, Greg Wooledge wrote: > > Meanwhile, I strongly advise you to rename this directory so that > it doesn't end with a carriage return. That would likely corrupt the volume, as $'/.HFS+ Private Directory Data\r' is part of the HFS+ implementation of directory hard

Re: Are there any plans for more readable, modern syntaxes for If statements?

2020-03-19 Thread Lawrence Velázquez
> On Mar 12, 2020, at 3:00 PM, Vaidas BoQsc > wrote: > > Are there any plans to have alternative, a more modern C or D like > syntaxes for IF statements, While loop and the like in Bash? > > Would it be better to just make a new shell and command language > similar to Bash instead of adding

Re: performance bug of [[ $x ]]

2020-03-07 Thread Lawrence Velázquez
> On Mar 7, 2020, at 7:33 PM, Peng Yu wrote: > > Could you show me how you do the profiling for this specific case? > Based on what proof that you can conclude that it is not the `[[` > performance problem? That's kind of a weird framing. The burden of proof is on *you* to prove your assertion

Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work

2020-08-29 Thread Lawrence Velázquez
> On Aug 29, 2020, at 8:41 PM, Bruce Lilly wrote: > >> On Sat, Aug 29, 2020 at 4:53 PM Koichi Murase wrote: >> >> Yes, I know that it is confusing to those who are familiar with modern >> Perl-style regular expressions. But historically, POSIX regular >> expressions do not support the

Re: Do a readline function execution inside bash

2020-09-14 Thread Lawrence Velázquez
> On Sep 14, 2020, at 9:59 PM, Budi wrote: > > simply run a readline function among lines codes of bash script such a > menu-complete, or previous-history repeated thrice, or etc That doesn't really answer Greg's question. What larger task are you trying to accomplish by invoking readline

Re: Bad substitution breaks conditional statement

2020-10-13 Thread Lawrence Velázquez
> On Oct 13, 2020, at 4:42 PM, Martin Schulte wrote: > > Hi Chet, hi all! > >> In general, variable expansion errors cause posix-mode shells to exit and >> bash default mode shells to abort execution of the current command and >> return to the top level, whether that is the command line or the

Re: Bad substitution breaks conditional statement

2020-10-12 Thread Lawrence Velázquez
> On Oct 12, 2020, at 1:23 AM, Martin Schulte wrote: > > It looks as if a bad substitution detected inside a case of if continues the > script flow immediately after the conditional statement skipping the > remaining statements inside the conditional. Please take a look into section >

Re: Bash Reference Mamual

2020-10-17 Thread Lawrence Velázquez
> On Oct 17, 2020, at 7:35 PM, Eduardo Bustamante wrote: > > <(cat file) and $(cat file) are not equivalent constructs. The former will > expand to a file name (e.g. "/dev/fd/63"), whereas the latter will expand > to the contents of the file. If you want terms you can look up, $(cat file) and

Re: backslashes in output of command substitution trigger GLOB

2020-10-10 Thread Lawrence Velázquez
> On Oct 10, 2020, at 10:23 PM, idal...@idallen.ca wrote: > > Description: >If a word in the output of a command substitution contains a >backslash, and the word (without backslash) happens to match a >file name, the shell will replace the word with the file name. >The backslashes

Re: Is this a bug?

2020-08-25 Thread Lawrence Velázquez
> On Aug 25, 2020, at 3:47 PM, George R Goffe wrote: > > I have gone searching for doc on how to set alarm behavior in > konsole. I found none. I have written a bug about his at the KDE > bug site. ARGH! They have been singularly unresponsive when it comes > to bug reports. We'll see. This

Re: How anchor to line end in regex

2020-08-22 Thread Lawrence Velázquez
Hi, > On Aug 22, 2020, at 10:13 PM, Budi wrote: > > How anchor to line end in bash regex [[ ]] > h=hi > [[ $h =~ ^hi\$ ]] && echo Yes > > cannot work, or is it bug yet Special characters are matched literally if they are quoted, so you just have to make sure the $ is not quoted. $

Re: O_DIRECT "packet mode" pipes on Linux

2020-09-23 Thread Lawrence Velázquez
> On Sep 23, 2020, at 11:41 PM, Vito Caputo wrote: > > On Wed, Sep 23, 2020 at 09:12:40AM -0400, Chet Ramey wrote: >> On 9/22/20 11:23 PM, Vito Caputo wrote: >>> Hello list, >>> >>> Is there any chance we could get a | modifier for enabling O_DIRECT on the >>> created pipe? "Packet" style

Re: Command "read -N " doesn't respect UTF-8 encoding

2020-10-24 Thread Lawrence Velázquez
> On Oct 24, 2020, at 3:51 PM, i...@kablex.ru 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_$ >

Re: Integer (re)declaration keeps string values

2020-07-22 Thread Lawrence Velázquez
> On Jul 22, 2020, at 4:12 AM, andrej--- via Bug reports for the GNU > Bourne Again SHell wrote: > > Description: > Integer variables don't get (re)parsed when (re)declared. > > Repeat-By: > a=z >declare -i a >echo $a # z (I'd expect emptiness or 0) The man page

Re: set -u not working as expected

2020-08-01 Thread Lawrence Velázquez
> On Aug 1, 2020, at 2:48 PM, Kristof Burek wrote: > > set -u # Bash complains and exits on first use of an unbound name With respect to set -u neither the bash man page nor POSIX.1-2017 refer to "use" of parameters, but to their *expansion*. > s+='t' # Line 8 - Bash should fail here I don't

Re: Undocumented for-loop construct

2020-08-06 Thread Lawrence Velázquez
> On Aug 6, 2020, at 10:29 PM, Dale R. Worley wrote: > > Klaas Vantournhout writes: >> Recently I came across a surprising undocumented bash-feature >> >> $ for i in 1 2 3; { echo $i; }; >> >> The usage of curly-braces instead of the well-documented do ... done >> construct was a complete

Re: Syntax error in a Map/Hash initializer -- why isn't this supported?

2020-08-10 Thread Lawrence Velázquez
> On Aug 10, 2020, at 6:44 PM, Eli Schwartz wrote: > > Instead of asking: > > "Can bash please implement multidimensional arrays as I think they're > nifty and would like to use them." Some prior art: https://lists.gnu.org/archive/html/bug-bash/2011-09/msg00061.html

Re: set -u not working as expected

2020-08-02 Thread Lawrence Velázquez
> On Aug 2, 2020, at 2:51 AM, Oğuz wrote: > > `u' has no members, so there's nothing to expand. If you use `${u[0]}' for > example, you'll see an error, I think how bash and ksh behave is perfectly > reasonable. Agreed. Their behavior logically follows from POSIX's carveout for $@. >> % bash

Re: set -u not working as expected

2020-08-01 Thread Lawrence Velázquez
> On Aug 1, 2020, at 8:47 PM, Lawrence Velázquez wrote: > > Presumably none of these shells implements u+=(t) as u=("${u[@]}" t). Granted, they do disagree on ${u[@]}. % bash -c 'set -u; unset u; u=("${u[@]}" t); typeset -p u' declare -a u=([0]="t") %

Re: bash 1-liner or function to tee to STDERR in middle of pipe?

2020-07-03 Thread Lawrence Velázquez
> On Jul 3, 2020, at 10:32 AM, bug-b...@trodman.com wrote: > > This does what I want: > > --8<---cut here---start->8--- > _tee_stderr () > { > <<'eohd' >SYNOPSIS > >ourname > >DESCRIPTION > >Use in a pipe. Leaks STDIN to

Re: Return from function depending on number of parameters

2020-07-03 Thread Lawrence Velázquez
> On Jul 3, 2020, at 2:00 PM, Chris Elvidge wrote: > > However 'N=0; echo $((!$N))' gives an error at the bash prompt. > 'echo $[!$N]' echo's 1 as expected. > > My question - is $[...] actually obsolete? It might tell you something that $[...] is not even mentioned in the man page for bash

Re: Return from function depending on number of parameters

2020-07-04 Thread Lawrence Velázquez
> On Jul 4, 2020, at 8:12 AM, pepa65 wrote: > > On 04/07/2020 04.39, Lawrence Velázquez wrote: >> It might tell you something that $[...] is not even mentioned in >> the man page for bash 3.2.57, which is decidedly not the current >> version. > > About that,

Re: hash -l with empty hash table prints to stdout

2020-06-16 Thread Lawrence Velázquez
> On Jun 16, 2020, at 10:51 AM, Chet Ramey > wrote: > >> On 6/16/20 10:26 AM, Eli Schwartz wrote: >> >>> On 6/16/20 9:56 AM, Chet Ramey wrote: >>> >>> It's not a warning; there's nothing to warn about. An empty hash >>> table is not an exceptional condition. It's simply informational. >> >>

Re: Bug on bash shell - $PWD (and consequentely prompt) not updated while renaming current folder.

2020-06-19 Thread Lawrence Velázquez
Hi, > On Jun 19, 2020, at 8:51 PM, corr...@goncalo.pt wrote: > > Bash Version: 5.0 > Patch Level: 11 > Release Status: release > Description: > When we rename the current working directory, $PWD doesn't get updated > as it would as it would if we just did a simple "cd directory". Because > of

Re: Bug on bash shell - $PWD (and consequentely prompt) not updated while renaming current folder.

2020-06-20 Thread Lawrence Velázquez
> On Jun 20, 2020, at 11:26 AM, Ilkka Virta wrote: > >> On 20.6. 3.51, corr...@goncalo.pt wrote: >> >> When we rename the current working directory, $PWD doesn't get updated >> as it would as it would if we just did a simple "cd directory". Fix: >> Probably: Trigger the current working

Re: Command substitution

2020-06-03 Thread Lawrence Velázquez
> On Jun 3, 2020, at 3:18 AM, Martin Schulte > wrote: > >> Unfortunely, I don't retrieve this behaviour in man page. > > Me neither, maybe the manual should read > > If the substitution appears within double quotes *or as the right-hand > side of an variable assignment*, word splitting and

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

2020-07-27 Thread Lawrence Velázquez
> On Jul 27, 2020, at 1:31 AM, Dale R. Worley wrote: > > Alexey Izbyshev writes: >> I have a question about the following behavior: >> >> $ Z='a b' >> $ A=(X=$Z) >> $ declare -p A >> declare -a A=([0]="X=a b") >> $ A=(X$Z) >> $ declare -p A >> declare -a A=([0]="Xa" [1]="b") >> >> I find it

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

2020-07-27 Thread Lawrence Velázquez
> On Jul 27, 2020, at 4:02 AM, Andreas Schwab wrote: > > 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 t

Re: Error expanding variable containing a directory name

2020-07-23 Thread Lawrence Velázquez
> On Jul 23, 2020, at 12:08 PM, Lutz Adam wrote: > > Bash Version: 5.0 > Patch Level: 17 > Release Status: release > > Description: >The content of $ML is "/media/lad". There's a directory >/media/lad/p24. Typing the command > ls $ML/p24 >a backslash is put

Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?)

2020-12-08 Thread Lawrence Velázquez
> On Dec 8, 2020, at 3:52 PM, Testing Purposes > wrote: > > FINAL THOUGHT — BASH FEATURE SUGGESTION: > > At the moment, this external command line reveals the version of Readline > that Bash is using: > > gdb bash -batch -ex 'printf "%04x\n", (int) rl_readline_version' > > Given how utterly

Re: How is it explained about the `local` is valid variable

2020-11-24 Thread Lawrence Velázquez
> On Nov 24, 2020, at 8:06 PM, Budi wrote: > > Can we validly write a line > > unset local a b c d e f g h i > > to mean: local a b c d e f g h i;unset a b c d e f g h i No. Have you looked at the documentation for "unset"? vq P.S. Again, not a bug. Not appropriate for bug-bash.

Re: mysteries with the placeholder variable _

2020-12-12 Thread Lawrence Velázquez
> On Dec 12, 2020, at 5:51 PM, Léa Gris wrote: > > It raises multiple observations: > > - I thought the placeholder variable _ was a sinkhole like /dev/null. It is not. I expect you've been deceived by countless examples like: read var1 var2 _ var3 _ var4 Your three non-dash shells

Re: Feature request

2020-11-08 Thread Lawrence Velázquez
> On Nov 8, 2020, at 6:49 PM, Budi wrote: > > Need feature on while's readily flag > > $ i=;while ((i<5)) ;do let i++ ;echo $i ;done ;echo $? > 1 > 2 > 3 > 4 > 5 > 0 > > $ i=7;while ((i<5)) ;do let i++ ;echo $i ;done ;echo $? > 0 > > we need feature on while's ability to supply flag when it's

Re: Variable with the same name can't be declared in the local scope if the global one is declared read-only

2020-11-15 Thread Lawrence Velázquez
Hi, > On Nov 15, 2020, at 4:20 AM, 林博仁Buo-ren, Lin wrote: > > ## Current behavior > > ``` > $ LANG=C ./depict-the-variable-shadowing-phenomenon.bash > ./depict-the-variable-shadowing-phenomenon.bash: line 11: > local: variable_shadowed: readonly variable > ``` >

Re: Problem with reverse-i-search in 5.1.0(1)-rc1

2020-11-05 Thread Lawrence Velázquez
> On Nov 5, 2020, at 3:12 AM, Detlef Vollmann wrote: > > BTW, I found no way to set a readline variable from the > command line w/o an external file. > $ echo "set enable-bracketed-paste On" | bind -f - > didn't work. bind 'set enable-bracketed-paste On' -- vq

Re: local -p var prints nothing

2021-01-08 Thread Lawrence Velázquez
> On Jan 8, 2021, at 3:50 AM, William Park wrote: > > I don't know if it's a bug. Manpage says "local" builtin takes all the > options that "declare" takes. But, "local -p var" doesn't print > anything, where as "declare -p var" does. > > f1() > { >local a=123 >local -p a > } > >

Re: Arithmetic pow results incorrect in arithmetic expansion.

2021-01-08 Thread Lawrence Velázquez
> On Jan 8, 2021, at 11:19 PM, Hyunho Cho wrote: > > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -g -O2 > -fdebug-prefix-map=/build/bash-a6qmCk/bash-5.0=. > -fstack-protector-strong -Wformat -Werror=format-security -Wall > -Wno-parentheses -Wno-format-security > uname

Re: . and .. are included where they were excluded before

2021-01-26 Thread Lawrence Velázquez
> On Jan 26, 2021, at 12:51 AM, "" > wrote: > >> On 25/01/2021 21:36, gregrwm wrote: >> >> is this change in functionality a regression, a "fix", or a new >> feature? >> is there any option to exclude them? >> in all 3, .. is included in .? > > This seems to be as

Re: here strings fold newlines on MacOS

2021-01-30 Thread Lawrence Velázquez
> On Jan 30, 2021, at 9:28 PM, "" > wrote: > > Are you certain that you're not testing /bin/bash (version 3.2.57) in the > case of macOS? I ask because the bug you describe is said to have been > addressed by the release of 4.4-beta [1]. > > z. Bash no longer splits the expansion of

Re: problem-solution

2021-02-02 Thread Lawrence Velázquez
> On Feb 2, 2021, at 11:52 AM, Kevin Buchs wrote: > > Browsing around bashref, I found the lastpipe option and I tried it, but > it seemed to have no effect. > > Rather than just submit a bug report, I thought I would try to dig in and > find the problem and try to fix it. When I downloaded the

Re: 'wait' in command group in pipeline fails to recognize child process

2021-06-22 Thread Lawrence Velázquez
On Tue, Jun 22, 2021, at 6:32 PM, Martin Jambon wrote: > I would also mention pipelines here, since these are more commonly > used than () subshells. I don't know if there are other ways of > creating subshells. If that's all, I think it would be valuable > to mention those two cases rather than

Re: 'wait' in command group in pipeline fails to recognize child process

2021-06-22 Thread Lawrence Velázquez
On Tue, Jun 22, 2021, at 8:52 PM, Martin Jambon wrote: > It's better. However, the reader is still left wondering what "the > shell" is referring to in first sentence. Subshells aside, I have a hard time believing that "the process ID of the shell" confuses anybody in practice. Even POSIX

Re: Latest devel branch push

2021-05-15 Thread Lawrence Velázquez
On Sat, May 15, 2021, at 4:29 PM, Alex fxmbsw7 Ratchev wrote: > but is that the devel tree Switch to the "devel" branch. -- vq

Re: Prefer non-gender specific pronouns

2021-06-05 Thread Lawrence Velázquez
> On Jun 5, 2021, at 12:47 PM, John Passaro wrote: > > I can see a couple reasons why it would be a good thing, and in the con > column only "I personally don't have time to go through the manual and make > these changes". There don't seem to be many instances in the Texinfo source. #1,

Re: [PATCH] Prefer non-gender specific pronouns

2021-06-06 Thread Lawrence Velázquez
On Sun, Jun 6, 2021, at 12:35 AM, G. Branden Robinson wrote: > At 2021-06-05T23:29:58-0400, Lawrence Velázquez wrote: > > doc/oldbash.texi > > 178:manual. Brian and Diane would like to thank Chet Ramey for his > > 9138:# The alternative explanation is

Re: parameter expansion with `:` does not work

2021-07-07 Thread Lawrence Velázquez
On Wed, Jul 7, 2021, at 6:37 PM, lisa-as...@perso.be wrote: > So you used `:` at the beginning and it worked? Chet and Greg already spelled out your mistake. It has nothing to do with the ':' command. -- vq

Re: parameter expansion with `:` does not work

2021-07-07 Thread Lawrence Velázquez
> On Jul 7, 2021, at 10:38 PM, lisa-as...@perso.be wrote: > > Correct. How do others customarily use `${fdir:=$PWD}` ? The common idiom is : "${fdir:=$PWD}" The ':' utility is used because it does nothing, but its arguments are expanded as usual. > I'd rather understand what's going on,

Re: bash on Tru64

2021-06-29 Thread Lawrence Velázquez
On Tue, Jun 29, 2021, at 4:38 PM, Jay K wrote: > diff -u input_avail.c.orig input_avail.c > --- input_avail.c.orig  2019-12-26 13:59:17.0 -0800 > +++ input_avail.c       2021-06-29 12:48:19.407119600 -0700 > @@ -110,7 +110,7 @@ >  #if defined(HAVE_SELECT) >    fd_set readfds, exceptfds; >  

Re: export loses error

2021-02-08 Thread Lawrence Velázquez
> On Feb 8, 2021, at 5:29 PM, gregrwm wrote: > > $ export vim=$HOME/.GVim-v8.2.2451.glibc2.15-x86_64.AppImage > $ > $ vimV=$($vim --version)||echo handle error here #without > export, error is captured > fuse: failed to exec fusermount: No such file or directory > open dir error:

Re: Wanted: quoted param expansion that expands to nothing if no params

2021-03-23 Thread Lawrence Velázquez
> On Mar 23, 2021, at 11:43 PM, Eli Schwartz wrote: > > On 3/23/21 11:24 PM, L A Walsh wrote: >> Too often I end up having to write something like >> if (($#)); then "$@" >> else # = function or executable call >> fi >> >> It would be nice to have a expansion that preserves arg

Re: Defaults -- any

2021-03-30 Thread Lawrence Velázquez
On Tue, Mar 30, 2021, at 12:54 PM, L A Walsh wrote: > On 2021/03/29 20:04, Greg Wooledge wrote: > > On Mon, Mar 29, 2021 at 07:25:53PM -0700, L A Walsh wrote: > > > >> > >>I have both /etc/profile and /etc/bashrc call my configuration > >> scripts. Are there common paths that don't call

Re: incorrect character handling

2021-03-30 Thread Lawrence Velázquez
On Tue, Mar 30, 2021, at 4:50 PM, Greg Wooledge wrote: > On Wed, Mar 31, 2021 at 02:31:46AM +0700, by.sm--- via Bug reports for > the GNU Bourne Again SHell wrote: > > poc=whoami > > $poc > > python3 -c "print('!!')" > > > > That return 'whoami' command. > > You're running into the csh-style

Re: how does ssh cause this loop to preterminate?

2021-03-24 Thread Lawrence Velázquez
> On Mar 24, 2021, at 5:21 PM, gregrwm wrote: > > Oddly, somehow, invoking ssh in a loop causes the loop to preterminate. > Why? https://mywiki.wooledge.org/BashFAQ/089 vq

Re: Changing the way bash expands associative array subscripts

2021-03-16 Thread Lawrence Velázquez
> On Mar 15, 2021, at 9:03 PM, Léa Gris wrote: > > Please excuse my profanity of mentioning zsh in this list, but I really think > features and behavior convergence can benefit end users in multiple ways, > especially when expanding beyond the POSIX sh scope. > > What direction has taken zsh

Re: Likely Bash bug

2021-03-16 Thread Lawrence Velázquez
> On Mar 16, 2021, at 11:08 PM, Dennis Williamson > wrote: > > I've been playing with your optimized code changing the read to grab data > in chunks like some of the other optimized code does - thus extending your > move from by-word to by-line reading to reading a specified larger number > of

Re: Likely Bash bug

2021-03-16 Thread Lawrence Velázquez
> On Mar 16, 2021, at 6:01 PM, Jay via Bug reports for the GNU Bourne Again > SHell wrote: > > Hello, > > I have been using/exploring Linux for ~ 2yrs; have corrupted a couple > systems more than once either through their instability with libraries > or just excess stress. > > I

Re: enhancement merge request

2021-04-18 Thread Lawrence Velázquez
> On Apr 18, 2021, at 7:12 PM, Ananth Chellappa wrote: > > Even this guy https://paulh.consulting/ > thought it was easy before deciding it was worth $500 of his time to try > adding it :) I don't know who "this guy" is. There are a lot of very skilled developers who aren't specifically versed

Re: enhancement merge request

2021-04-19 Thread Lawrence Velázquez
> On Apr 19, 2021, at 7:18 AM, Greg Wooledge wrote: > > On Mon, Apr 19, 2021 at 01:16:48AM -0400, Grisha Levit wrote: >> I think you can do something similar to the patch directly in the shell by >> temporarily unsetting HISTFILE and then deleting history entries in a >> certain range and

Re: enhancement merge request

2021-04-18 Thread Lawrence Velázquez
Hi, > On Apr 18, 2021, at 12:03 AM, Ananth Chellappa wrote: > > Hello Brian and Chet, > Please consider merging the enhancement made by Naseeba described > here : > > https://github.com/ananthchellappa/bash-5.1/blob/main/README.md In your future emails, you may want to consider -

Re: When "set -u", "which" outputs environment: line 1: _declare: unbound

2021-04-09 Thread Lawrence Velázquez
On Fri, Apr 9, 2021, at 4:51 PM, Eli Schwartz wrote: > Are you ready to have your day truly spoiled? Fedora's package for the > external program GNU which, provides this /etc/profile.d/ script > (automatically injected into the environment of any interactive shell > sessions once you install GNU

Re: syntax error while parsing a case command within `$(...)'

2021-02-15 Thread Lawrence Velázquez
> On Feb 15, 2021, at 10:01 AM, Chet Ramey wrote: > > The bash command substitution parser handles the majority of these > cases (heh) lol I chuckled, well done vq

Re: syntax error while parsing a case command within `$(...)'

2021-02-17 Thread Lawrence Velázquez
> On Feb 17, 2021, at 10:27 PM, Dale R. Worley wrote: > > Lawrence Velázquez writes: >>>> `;;' is optional for the last case item. >>> >>> The manual page (for my version) says it's required. If, in some >>> certain circumstances, it works

Re: syntax error while parsing a case command within `$(...)'

2021-02-16 Thread Lawrence Velázquez
> On Feb 16, 2021, at 10:42 PM, Dale R. Worley wrote: > >> Oğuz writes: >> >> `;;' is optional for the last case item. > > The manual page (for my version) says it's required. If, in some > certain circumstances, it works without, that's nice. It's also required by POSIX. > But there's no

Re: ixz.bug.1.varnotnewalias

2021-02-05 Thread Lawrence Velázquez
> On Feb 5, 2021, at 12:52 PM, Alex fxmbsw7 Ratchev wrote: > > bash-5.1# bash -x ixz.bug.varnotnewalias 2>&1 | gawk '/aixz=|alias --|not > fou/' > + aixz=("$ixzd"/+{ixz,kw}) > ++ alias -- '+ixz= > ++ alias -- '+kw= > ++ alias -- '+ixz= > ++ alias -- '+kw= > ixz.bug.varnotnewalias: line 13: KWS:

Re: ixz.bug.1.varnotnewalias

2021-02-05 Thread Lawrence Velázquez
> On Feb 5, 2021, at 3:40 PM, Alex fxmbsw7 Ratchev wrote: > > im sorry, in my terminal there is no unescaped ( or at all ) '(' in the > regex There are no parentheses in the gawk command I sent. It is identical to the one you sent initially. > see the display problem is.. > > bash-5.1# bash

Re: ixz.bug.1.varnotnewalias

2021-02-05 Thread Lawrence Velázquez
> On Feb 5, 2021, at 3:02 PM, Alex fxmbsw7 Ratchev wrote: > > i tried to report, that i tried to set the var new, but it didnt work so > second alias | source run returned same two firstly aixz=( .. ) defined > elements again > and the gawk which catched the first aixz=( .. but not the second,

Re: syntax error while parsing a case command within `$(...)'

2021-02-14 Thread Lawrence Velázquez
> On Feb 14, 2021, at 3:00 PM, Oğuz wrote: > > 14 Şubat 2021 Pazar tarihinde Dale R. Worley yazdı: > >> Before we worry about what to change, I want to note that the original >> example is syntactically incorrect. The example is >> >> $ bash -c ': $(case x in x) esac)' >> >> But the manual

Re: syntax error while parsing a case command within `$(...)'

2021-02-13 Thread Lawrence Velázquez
> On Sat, Feb 13, 2021, 21:34 Alex fxmbsw7 Ratchev wrote: > > you didnt end the case, wrong syntax > echo $( case x in y) printf 1 ;; x) printf 2 ;; esac ) $ case x in x) esac $ echo $? 0 > On Feb 13, 2021, at 3:36 PM, Alex fxmbsw7 Ratchev wrote: > > you have to specify something for ) even

Re: syntax error while parsing a case command within `$(...)'

2021-02-13 Thread Lawrence Velázquez
> On Feb 13, 2021, at 5:21 PM, Robert Elz wrote: > > This problem has been known for a LONG time, without it being fixed. I played around with shbot on Freenode for a bit. "LONG time" is right: bash50 -c ': $(case x in x) esac)' bash50: -c: line 0: unexpected EOF while looking for matching

Re: Issue declaring an array via a variable name

2021-08-22 Thread Lawrence Velázquez
On Sun, Aug 22, 2021, at 4:38 PM, Alex fxmbsw7 Ratchev wrote: > last time again You promise? > one pair quotes, not more Except you're wrong. $ val=foo $ declare "$val"='x' $ declare -p "$val" declare -- foo="x" $ val=bar $ declare -a "$val"='(baz quux)' $ declare -p "$val" declare -a

Re: [feature request] parameter transformation to safely add strings to PS1, .

2021-08-22 Thread Lawrence Velázquez
> On Aug 22, 2021, at 10:22 PM, Koichi Murase wrote: > > 2021年8月23日(月) 6:13 Emanuele Torre : >> It would be nice to have a parameter transformation (e.g. "${par@p}") >> that expands $par to a string that will not be expanded by PS1, PS2, > > It seems to me that you can just put '$par' (not

Re: Handling options with optional arguments with getopts

2021-08-27 Thread Lawrence Velázquez
On Fri, Aug 27, 2021, at 1:20 PM, nigelberlinguer wrote: > ‐‐‐ Original Message ‐‐‐ > On Friday, August 27, 2021 4:02 PM, Robert Elz wrote: > > XBD 12.2 guideline 7 is: > > > > Guideline 7: Option-arguments should not be optional. > > > > That is, if you want to be able to give an option

Re: Squiggly heredoc - new feature request

2021-08-31 Thread Lawrence Velázquez
On Tue, Aug 31, 2021, at 4:02 AM, Lawrence Velázquez wrote: > ksh does not blindly remove all leading whitespace For the curious, this is how ksh(1) describes it: If '#' is appended to '<<', then leading spaces and tabs will be stripped off the first line of the docume

Re: Defect in manual section "Conditional Constructs" / case

2021-08-24 Thread Lawrence Velázquez
On Tue, Aug 24, 2021, at 4:44 PM, Dietmar P. Schindler wrote: > Doesn't the example I gave above show that quotes are removed? If they > weren't, how could word aa with pattern a""a constitute a match? The quotes are handled by the matching process itself, *not* as part of the usual shell

Re: Squiggly heredoc - new feature request

2021-08-30 Thread Lawrence Velázquez
On Mon, Aug 30, 2021, at 4:06 PM, Přemysl Šťastný wrote: > I think, it would be nice, if you implemented Squiggly heredoc, which > solves this problem by ignoring both leading spaces and leading tabs. eg. > > func()( >   cat <<~ EOF >     blabla >   EOF > ) '<<~' is already syntactically

Re: Squiggly heredoc - new feature request

2021-08-30 Thread Lawrence Velázquez
On Mon, Aug 30, 2021, at 5:22 PM, Přemysl Šťastný wrote: > Will ksh93 version ever get to upstream? I don't know what you mean by that. ksh is not "downstream" of bash; it is a separate project. Whether bash incorporates this feature or one like it is up to Chet, who hasn't yet chimed in. >

Re: Squiggly heredoc - new feature request

2021-08-31 Thread Lawrence Velázquez
> On Aug 31, 2021, at 3:16 AM, Přemysl Šťastný wrote: > > I didn't realize yesterday, that ksh93 is not a nick name, but ksh version > 93. :D Sort of. > So it would be okey with you, if I try to implement it using <<#? The bash maintainer (who is not me) hasn’t yet indicated whether this is

Re: @K transformation

2021-08-20 Thread Lawrence Velázquez
On Fri, Aug 20, 2021, at 6:11 PM, Léa Gris wrote: > Le 21/08/2021 à 00:06, Chet Ramey écrivait : > > The best way to clone an associative array is: > > > > declare -A options > > eval options=\( "${assoc[@]@K}" \) > > > > The quoting @K performs is eval-safe. > > > > Although I was not

Re: Exclamation mark when using character classes

2021-08-21 Thread Lawrence Velázquez
> On Fri, Aug 20, 2021 at 10:30 PM hancooper via Bug reports for the GNU > Bourne Again SHell bug-bash@gnu.org wrote: > > I am using EPOCHREALTIME and then computing the corresponding human > readable form, that can handle > changes in locale > now=$EPOCHREALTIME > printf -v second '%(%S)T.%s'

Re: An alias named `done` breaks for loops

2021-08-14 Thread Lawrence Velázquez
On Sat, Aug 14, 2021, at 6:59 PM, George Nachman wrote: > Description: > Defining an alias named `done` breaks parsing a for loop that does not have > an `in word` clause. > > > Repeat-By: > > Run the following script. It fails with this error: > > myscript.bash: line 7: syntax error near

Re: "printf -v foo bar" sets $? to 1

2021-08-14 Thread Lawrence Velázquez
On Sat, Aug 14, 2021, at 7:56 PM, Keith Thompson wrote: > Bash Version: 5.1 > Patch Level: 4 > Release Status: maint > > Description: > The builtin "printf" command with the "-v" option works > correctly, but it reports failure by setting $? to 1. > > The problem was

Re: Issue declaring an array via a variable name

2021-08-21 Thread Lawrence Velázquez
On Sat, Aug 21, 2021, at 6:02 PM, Hunter Wittenborn wrote: > In my head, something like this (where 'value' is equal to 'y'): > > `declare "${value}"="x"` > > becomes this (which it appears to do so): > > `declare "y"="x"` Almost. The argument parses without issue ('=' has no special meaning

Re: Defect in manual section "Conditional Constructs" / case

2021-08-25 Thread Lawrence Velázquez
On Wed, Aug 25, 2021, at 5:18 AM, Dietmar Schindler wrote: > > sent: 25. August 2021 02:14 > > from: "Lawrence Velázquez" > > Cc: bug-bash@gnu.org > > On Tue, Aug 24, 2021, at 4:44 PM, Dietmar P. Schindler wrote: > > > Doesn't the exampl

Re: help adding some features to 5.1

2021-09-01 Thread Lawrence Velázquez
On Wed, Sep 1, 2021, at 8:20 PM, Ananth Chellappa wrote: > I hope I can make a genuine contribution at some point. If you're hoping/planning on getting these changes accepted into bash, it might be worth hashing out details with Chet before expending your time and energy. (I am not a

Re: ?maybe? RFE?... read -h ?

2021-09-05 Thread Lawrence Velázquez
On Sun, Sep 5, 2021, at 11:11 PM, Dale R. Worley wrote: > L A Walsh writes: > > I know how -h can detect a symlink, but I was wondering, is > > there a way for bash to know where the symlink points (without > > using an external program)? > > My understanding is that it has been convention to

Re: ?maybe? RFE?... read -h ?

2021-09-06 Thread Lawrence Velázquez
On Mon, Sep 6, 2021, at 6:46 PM, L A Walsh wrote: > On 2021/09/05 20:54, Lawrence Velázquez wrote: > > The distribution ships with a "realpath" loadable builtin, FWIW. > > > > I didn't know that... um, my bash isn't quite there yet: > > Ishtar:/>

Re: help for needs to mention for ((...))

2021-09-19 Thread Lawrence Velázquez
On Sun, Sep 19, 2021, at 3:25 PM, 積丹尼 Dan Jacobson wrote: > $ help for > only mentions >for name [ [ in [ word ... ] ] ; ] do list ; done > and needs to be updated to mention >for (( expr1 ; expr2 ; expr3 )) ; do list ; done Not particularly intuitive, but: bash-5.1$ help 'for

Re: Command substitution fails in here-document delimiter.

2021-07-13 Thread Lawrence Velázquez
> On Jul 13, 2021, at 4:37 PM, Paul Gilmartin wrote: > > Description: > When "word" in here-document contains command substitution, > bash reports an error: > here: line 4: warning: here-document at line 2 delimited by end-of-file > (wanted `foo$( true )bar') > Man bash shows:

Re: gettext feature request

2021-07-31 Thread Lawrence Velázquez
On Sat, Jul 31, 2021, at 4:17 PM, Jean-Jacques Brucker wrote: > The advantage of adding such variable is that we could use more easily > different mo files in a same bash execution : > > (at least) one "legacy" (for /$"..."/) and (at least) one 'C-strings' > (for /$'...'/), which could then be

Re: current bash.git.devel segfaults on my code

2021-10-20 Thread Lawrence Velázquez
On Wed, Oct 20, 2021, at 5:07 PM, Alex fxmbsw7 Ratchev wrote: > you got other cmd suggestions i can run to help debugging ? im very limited > in bin.c debugging You could bisect the devel branch to determine whether your problem was caused by a change to bash and, if so, which commit is

Re: current bash.git.devel segfaults on my code

2021-10-20 Thread Lawrence Velázquez
On Wed, Oct 20, 2021, at 7:43 PM, Alex fxmbsw7 Ratchev wrote: > to tell u honestly, im in no state to read freely happily new docs I'll be honest as well: If you're not going to put in effort beyond running commands that are spoon-fed to you, then I'm not going to put in effort beyond dumping

Re: current bash.git.devel segfaults on my code

2021-10-24 Thread Lawrence Velázquez
On Sun, Oct 24, 2021, at 7:28 AM, Shehu Dikko wrote: > Use this tldr client to get all the git tips you need and much else besides: > > https://github.com/raylee/tldr-sh-client > > tldr: https://tldr.sh There's also #git on irc.libera.chat, if you prefer. -- vq

Re: Zero-length indexed arrays

2021-12-16 Thread Lawrence Velázquez
On Thu, Dec 16, 2021, at 11:45 PM, Lawrence Velázquez wrote: > Did you mean to say that ${#FOO[*]} causes an error? Because > ${FOO[*]} does not, à la $*: > > [...] > > Like ${FOO[*]}, ${FOO[@]} and $@ are exempt from ''set -u''. Perhaps you're using an old bash, like the one

Re: Zero-length indexed arrays

2021-12-16 Thread Lawrence Velázquez
On Thu, Dec 16, 2021, at 11:01 PM, Dale R. Worley wrote: > A bit ago I was debugging a failing script at work. It turns out that > when you say > FOO=(x y z) > then the variable FOO is an array and is defined. But when you say > FOO=() > then the variable FOO is an array (because

Re: Format specifier for printf in manual

2021-12-21 Thread Lawrence Velázquez
On Tue, Dec 21, 2021, at 5:40 PM, fatiparty--- via Bug reports for the GNU Bourne Again SHell wrote: > Have tried to read some information about the format specifier for > printf, particularly the width, precision and left justification for > %s, but could not find any.

Re: Zero-length indexed arrays

2021-12-21 Thread Lawrence Velázquez
On Tue, Dec 21, 2021, at 10:48 PM, Dale R. Worley wrote: > Lawrence Velázquez writes: >> Did you mean to say that ${#FOO[*]} causes an error? Because >> ${FOO[*]} does not, a la $*: > > The case that matters for me is the Bash that ships with "Oracle Linux".

Re: Unclosed quotes on heredoc mode

2021-11-23 Thread Lawrence Velázquez
On Tue, Nov 23, 2021, at 10:35 PM, Martijn Dekker wrote: > Op 20-11-21 om 23:54 schreef Robert Elz: >> What the devel one does is unknown to me, I don't think I even have >> the means to obtain it (I have nothing at all git related, and no interest >> in changing that state of affairs). > > Github

Re: Unclosed quotes on heredoc mode

2021-11-17 Thread Lawrence Velázquez
On Wed, Nov 17, 2021, at 7:35 AM, João Almeida Santos wrote: > I’m a programming student currently on 42 School in Lisbon, and one of > our projects is to create a minishell, and to mimic the behavior of > bash. Nice! > While testing the heredoc mode, I realized that the $ is not >

Re: Document -x and -vx give the same results

2021-11-14 Thread Lawrence Velázquez
On Sun, Nov 14, 2021, at 11:40 AM, 積丹尼 Dan Jacobson wrote: > Man page says: >-vPrint shell input lines as they are read. >-xPrint commands and their arguments as they are executed. > Perhaps mention that -x and -vx give the same results, often or always. They

Re: some.. bug .. ?

2021-11-28 Thread Lawrence Velázquez
On Sun, Nov 28, 2021, at 4:01 AM, Alex fxmbsw7 Ratchev wrote: > printf 'e=. ; (( $# > 1 )) && $e afile "${@:1:$# -1}"' >afile ; . afile 1 2 > 3 > > bash: : command not found > > > 1. the cmd=. works out, no command error > 2. on second+ run it shows this error, as bin/. is no command in $PATH > 3.

  1   2   3   >