Re: Bash 5.1 and Ncurses

2021-01-14 Thread Eli Schwartz
On 1/15/21 12:12 AM, Jeffrey Walton wrote: Hi Everyone, I configured Bash 5.1 with prefix=/usr/local, --with-curses and --enable-multibyte. The link failed with undefined references, like tputs. I have the wide char Ncurses built and installed in /usr/local. I found I needed to add -ltinfow to L

Bash 5.1 and Ncurses

2021-01-14 Thread Jeffrey Walton
Hi Everyone, I configured Bash 5.1 with prefix=/usr/local, --with-curses and --enable-multibyte. The link failed with undefined references, like tputs. I have the wide char Ncurses built and installed in /usr/local. I found I needed to add -ltinfow to LIBS and LDLIBS for the build to succeed. I'm

Re: Use of `mktemp' is dangerous, better use `mkstemp'...

2021-01-14 Thread Eli Schwartz
On 1/14/21 11:45 PM, Jeffrey Walton wrote: Hi Everyone, I'm building Bash 5.1 from sources. This may be of interest: /usr/bin/ld: ./lib/sh/libsh.a(tmpfile.o): in function `sh_mktmpname': /home/jwalton/Build-Scripts/bash-5.1/lib/sh/tmpfile.c:160: warning: the use of `mktemp' is dangerous, better

Use of `mktemp' is dangerous, better use `mkstemp'...

2021-01-14 Thread Jeffrey Walton
Hi Everyone, I'm building Bash 5.1 from sources. This may be of interest: /usr/bin/ld: ./lib/sh/libsh.a(tmpfile.o): in function `sh_mktmpname': /home/jwalton/Build-Scripts/bash-5.1/lib/sh/tmpfile.c:160: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp' Jeff

Re: bug-bash Digest, Vol 218, Issue 13

2021-01-14 Thread txm
On 1/14/21 9:58 PM, Chet Ramey wrote: On 1/11/21 11:00 AM, Thomas Mellman wrote: But here's a bug for you, in readline: - edit a line - go to some character - replace that character with another, using the "r" command. - cruise further down the line to another character - hit the "." repea

Re: bug-bash Digest, Vol 218, Issue 13

2021-01-14 Thread Chet Ramey
On 1/14/21 4:01 PM, txm wrote: On 1/14/21 9:58 PM, Chet Ramey wrote: On 1/11/21 11:00 AM, Thomas Mellman wrote: But here's a bug for you, in readline: - edit a line - go to some character - replace that character with another, using the "r" command. - cruise further down the line to anothe

Re: bug-bash Digest, Vol 218, Issue 13

2021-01-14 Thread Chet Ramey
On 1/11/21 11:00 AM, Thomas Mellman wrote: But here's a bug for you, in readline: - edit a line - go to some character - replace that character with another, using the "r" command. - cruise further down the line to another character - hit the "." repeat command The replace operation will n

Re: V+=1 doesn't work if V is a reference to an integer array element

2021-01-14 Thread Chet Ramey
On 1/14/21 10:31 AM, Léa Gris wrote: Le 14/01/2021 à 16:15, Chet Ramey écrivait : On 1/13/21 4:40 PM, Léa Gris wrote: Le 13/01/2021 à 22:13, Chet Ramey écrivait : The `-i' forces arithmetic evaluation, which makes this expand to the equivalent of `declare -n b=1'. That's an invalid name for a

Re: non-executable files in $PATH cause errors

2021-01-14 Thread Chet Ramey
On 1/14/21 5:15 AM, Robert Elz wrote: I suspect what you're being confused by, is that the "searches for" is typically done (in shells, I have no idea what the code inside bash is like) by simply taking each element of PATH, appending "/command_name" and attempting an exec. If that succeeds,

Re: Feature Request: C struct-like template

2021-01-14 Thread Chet Ramey
On 1/14/21 4:44 AM, William Park wrote: Here is another feature request. In C struct, eg. struct { char date[7], dev[16], ver[32], rev[10], ... } you just access variables, and compiler will do the offsetting. I would like something like that, where I don't have to do the book

Re: V+=1 doesn't work if V is a reference to an integer array element

2021-01-14 Thread Léa Gris
Le 14/01/2021 à 16:15, Chet Ramey écrivait : On 1/13/21 4:40 PM, Léa Gris wrote: Le 13/01/2021 à 22:13, Chet Ramey écrivait : The `-i' forces arithmetic evaluation, which makes this expand to the equivalent of `declare -n b=1'. That's an invalid name for a nameref, which you'd see if you used

Re: V+=1 doesn't work if V is a reference to an integer array element

2021-01-14 Thread Chet Ramey
On 1/13/21 4:40 PM, Léa Gris wrote: Le 13/01/2021 à 22:13, Chet Ramey écrivait : The `-i' forces arithmetic evaluation, which makes this expand to the equivalent of `declare -n b=1'. That's an invalid name for a nameref, which you'd see if you used `declare -n b=1' instead. The assignment error

Re: Feature Request: C struct-like template

2021-01-14 Thread Greg Wooledge
On Thu, Jan 14, 2021 at 07:16:12PM +0700, pepa65 wrote: > On 14/01/2021 16.44, William Park wrote: > > Then, I just use variable "rev" and that would be equivalent to > > ${@:55:10}. > > So you could just do: rev=(${template[@]:55:10}) Needs more quotes.

Re: non-executable files in $PATH cause errors

2021-01-14 Thread Greg Wooledge
I give up trying to quote appropriate context. Here's what bash 5.0 is doing: unicorn:~$ echo "$PATH" /home/greg/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin unicorn:~$ type moo bash: type: moo: not found unicorn:~$ echo "echo M" > ./bin/moo unicorn:~$ moo bash

Re: Feature Request: C struct-like template

2021-01-14 Thread pepa65
On 14/01/2021 16.44, William Park wrote: > Then, I just use variable "rev" and that would be equivalent to > ${@:55:10}. So you could just do: rev=(${template[@]:55:10}) With a little function like this, you could call: Struct template date 7 dev 16 ver 32 rev 10 and get what you want with an exi

Re: non-executable files in $PATH cause errors

2021-01-14 Thread Robert Elz
Date:Wed, 13 Jan 2021 21:45:08 -0500 From:wor...@alum.mit.edu (Dale R. Worley) Message-ID: <87im806xu3@hobgoblin.ariadne.com> | Of course, as described in the manual page, Bash first searches for an | executable with the right name in the PATH, and then if that

Feature Request: C struct-like template

2021-01-14 Thread William Park
Here is another feature request. In C struct, eg. struct { char date[7], dev[16], ver[32], rev[10], ... } you just access variables, and compiler will do the offsetting. I would like something like that, where I don't have to do the bookkeeping. Right now, I am doing set -- .