parameter expansion with `:` does not work

2021-07-07 Thread lisa-asket
From: Chet Ramey To: lisa-as...@perso.be;    bug-bash@gnu.org Subject: Re: parameter expansion with `:` does not work Date: 08/07/2021 00:14:36 Europe/Paris Cc: chet.ra...@case.edu On 7/7/21 6:12 PM, lisa-as...@perso.be wrote: > > : ${fltype:-"texi,org"}  # alternative to `fltype=` > > > I'm

parameter expansion with `:` does not work

2021-07-07 Thread lisa-asket
> From: Greg Wooledge > To: bug-bash@gnu.org > Subject: Re: parameter expansion with `:` does not work > Date: 08/07/2021 00:44:09 Europe/Paris > On Thu, Jul 08, 2021 at 12:37:07AM +0200, lisa-as...@perso.be wrote: > >From: Dennis Williamson > >$ : ${foo:-bar} > >$ : ${foo:=bar} > >The first

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 Greg Wooledge
On Wed, Jul 07, 2021 at 11:50:01PM +0200, lisa-as...@perso.be wrote: > Have noticed that parameter expansion with `:` does not work > > : ${fltype:-"texi,org"}  # alternative to `fltype=` What did it do? What did you *expect* it to do? This looks like it's related to your ongoing project to

parameter expansion with `:` does not work

2021-07-07 Thread lisa-asket
From: Chet Ramey To: lisa-as...@perso.be;    bug-bash@gnu.org Subject: Re: parameter expansion with `:` does not work Date: 08/07/2021 00:08:23 Europe/Paris Cc: chet.ra...@case.edu On 7/7/21 5:50 PM, lisa-as...@perso.be wrote: > > Have noticed that parameter expansion with `:` does not work >

parameter expansion with `:` does not work

2021-07-07 Thread lisa-asket
>From: Greg Wooledge >To: bug-bash@gnu.org >Subject: Re: parameter expansion with `:` does not work >Date: 07/07/2021 23:54:21 Europe/Paris >On Wed, Jul 07, 2021 at 11:50:01PM +0200, lisa-as...@perso.be wrote: >> Have noticed that parameter expansion with `:` does not work >> >> :

Re: parameter expansion with `:` does not work

2021-07-07 Thread Chet Ramey
On 7/7/21 6:10 PM, lisa-as...@perso.be wrote: The line : ${fltype:-"texi,org"} should be an alternative to fltype=${fltype:-"texi,org"} It absolutely is not. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet

parameter expansion with `:` does not work

2021-07-07 Thread lisa-asket
>From: Greg Wooledge >To: bug-bash@gnu.org >Subject: Re: parameter expansion with `:` does not work >Date: 08/07/2021 00:21:33 Europe/Paris >On Thu, Jul 08, 2021 at 12:10:27AM +0200, lisa-as...@perso.be wrote: >> The line >> : ${fltype:-"texi,org"}  >> should be an alternative to >>

Re: parameter expansion with `:` does not work

2021-07-07 Thread Chet Ramey
On 7/7/21 6:12 PM, lisa-as...@perso.be wrote: > : ${fltype:-"texi,org"}  # alternative to `fltype=` > I'm not sure why you think that's an alternative. Maybe you meant ${fltype:="texi,org"}? It is supposed to be built into bash so a new process is not created. Perhaps not in Gnu Bash? What

parameter expansion with `:` does not work

2021-07-07 Thread lisa-asket
>From: Lawrence Velázquez >To: lisa-as...@perso.be >Subject: Re: parameter expansion with `:` does not work >Date: 08/07/2021 00:39:55 Europe/Paris >Cc: bug-bash@gnu.org >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

parameter expansion with `:` does not work

2021-07-07 Thread lisa-asket
Have noticed that parameter expansion with `:` does not work : ${fltype:-"texi,org"}  # alternative to `fltype=`

Re: parameter expansion with `:` does not work

2021-07-07 Thread Greg Wooledge
On Thu, Jul 08, 2021 at 12:37:07AM +0200, lisa-as...@perso.be wrote: > >From: Dennis Williamson > >$ : ${foo:-bar} > >$ : ${foo:=bar} > >The first form is a substitution and the second form is an assignment. > So you used `:` at the beginning and it worked? Are you incapable of seeing the

Re: parameter expansion with `:` does not work

2021-07-07 Thread Chet Ramey
On 7/7/21 6:53 PM, lisa-as...@perso.be wrote: Yes I can see one has :- and the other has  := But I also noticed : at the front, with someone saying that the command does not exist in Gnu Bash. No one implied that `the command' is not present in bash. Seriously, just replace the :- expansion

[Request]: Make `history-search` key bindings slightly more user-friendly

2021-07-07 Thread Rashil Gandhi via Bug reports for the GNU Bourne Again SHell
Configuration Information [Automatically generated, do not change]:Machine: x86_64OS: linux-gnuCompiler: gccCompilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-a6qmCk/bash-5.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-parentheses -Wno-format-securityuname

Re: parameter expansion with `:` does not work

2021-07-07 Thread Greg Wooledge
On Thu, Jul 08, 2021 at 12:10:27AM +0200, lisa-as...@perso.be wrote: > The line > : ${fltype:-"texi,org"}  > should be an alternative to > fltype=${fltype:-"texi,org"}  As Chet guessed earlier, you probably meant := instead of :- . I started typing something to that effect in my first

parameter expansion with `:` does not work

2021-07-07 Thread lisa-asket
>From: Dennis Williamson >To: lisa-as...@perso.be >Subject: Re: parameter expansion with `:` does not work >Date: 08/07/2021 00:28:33 Europe/Paris >Cc: bug-bash >On Wed, Jul 7, 2021, 4:50 PM wrote: >Have noticed that parameter expansion with `:` does not work >: ${fltype:-"texi,org"}  #

Re: parameter expansion with `:` does not work

2021-07-07 Thread Greg Wooledge
On Thu, Jul 08, 2021 at 12:33:04AM +0200, lisa-as...@perso.be wrote: > Talking about neater design choices, you seem to imply you have some other > way to take user options that are composed of lists, so that one does not use > a delimited string. What is it? I wrote a detailed message containing

Re: parameter expansion with `:` does not work

2021-07-07 Thread Chet Ramey
On 7/7/21 5:50 PM, lisa-as...@perso.be wrote: Have noticed that parameter expansion with `:` does not work : ${fltype:-"texi,org"}  # alternative to `fltype=` > I'm not sure why you think that's an alternative. Maybe you meant ${fltype:="texi,org"}? -- ``The lyf so short, the craft so

Re: parameter expansion with `:` does not work

2021-07-07 Thread Dennis Williamson
On Wed, Jul 7, 2021, 4:50 PM wrote: > > Have noticed that parameter expansion with `:` does not work > > > > : ${fltype:-"texi,org"} # alternative to `fltype=` > > $ unset foo $ : ${foo:-bar} $ echo "$foo" $ : ${foo:=bar} $ echo "$foo" bar The first form is a substitution and the second

Re: parameter expansion with `:` does not work

2021-07-07 Thread Chet Ramey
On 7/7/21 6:48 PM, lisa-as...@perso.be wrote: I have some difficulty understanding the difference between ${parameter:-word} and ${parameter:=word}, and when it is appropriate to use one as opposed to the other. Dennis Williamson succinctly summarized the differences. ${parameter:-word}

Re: parameter expansion with `:` does not work

2021-07-07 Thread Dennis Williamson
On Wed, Jul 7, 2021, 7:55 PM wrote: > > > Things are clearer now. > > > > > Seriously, just replace the :- expansion with := and go on with your > code. > > It's the least intrusive change, and won't disturb your logic. > > > > I executed > > > > echo "${parameter:-word}"; echo "${parameter}" >

Re: parameter expansion with `:` does not work

2021-07-07 Thread Kerin Millar
On Thu, 8 Jul 2021 02:54:06 +0200 (CEST) lisa-as...@perso.be wrote: > As I was in it, have also changed  > > > > fdir=${fdir:-$PWD} This makes sense. > > > > to > > > > fdir=${fdir:=$PWD} Here, you are using a form of parameter expansion that intrinsically performs variable

parameter expansion with `:` does not work

2021-07-07 Thread lisa-asket
> From: Kerin Millar > To: Dennis Williamson > Subject: Re: parameter expansion with `:` does not work > Date: 08/07/2021 03:51:15 Europe/Paris > Cc: lisa-as...@perso.be; >    Greg Wooledge ; >    bug-bash ; >    Chester Ramey > On Thu, 8 Jul 2021 02:54:06 +0200 (CEST) > lisa-as...@perso.be

Re: parameter expansion with `:` does not work

2021-07-07 Thread Greg Wooledge
> > fdir=${fdir:=$PWD} > > Ack! I know. I simply gave up. At least this will "work", even if it's completely silly.

parameter expansion with `:` does not work

2021-07-07 Thread lisa-asket
>From: Lawrence Velázquez >To: lisa-as...@perso.be >Subject: Re: parameter expansion with `:` does not work >Date: 08/07/2021 05:23:48 Europe/Paris >Cc: bug-bash@gnu.org >> On Jul 7, 2021, at 10:38 PM, lisa-as...@perso.be wrote: >> >> Correct. How do others customarily use `${fdir:=$PWD}` ?

Re: parameter expansion with `:` does not work

2021-07-07 Thread Greg Wooledge
On Thu, Jul 08, 2021 at 04:38:25AM +0200, lisa-as...@perso.be wrote: > I'd rather understand what's going on, rather than simply never use it. OK. Let's start from the beginning. In sh and bash, anything that begins with a $ is potentially a substitution, a.k.a. an expansion. The parser will

parameter expansion with `:` does not work

2021-07-07 Thread lisa-asket
From: Chet Ramey To: lisa-as...@perso.be;    Greg Wooledge ;    bug-bash@gnu.org Subject: Re: parameter expansion with `:` does not work Date: 08/07/2021 00:59:52 Europe/Paris Cc: chet.ra...@case.edu On 7/7/21 6:53 PM, lisa-as...@perso.be wrote: > > Yes I can see one has :- and the other has 

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,