help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does quote removal work with alternative forms of parameter expa


From: Koichi Murase
Subject: Re: How does quote removal work with alternative forms of parameter expansion?
Date: Mon, 27 May 2024 11:23:46 +0900

2024年5月27日(月) 11:03 Koichi Murase <myoga.murase@gmail.com>:
> 2024年5月27日(月) 9:38 Philippe Cerfon <philcerf@gmail.com>:
> > I guess I do (kind of) understand now how it's done in bash, but which
> > rules should one follow if one tries to program portable?

FYI, I use the following regular-expression patterns (in PCRE for
bash-completion / ERE for ble.sh) to detect suspicious lines (which is
it's not perfect). These also include the detections for the cases
that trigger bugs in older Bash versions.

- 
https://github.com/scop/bash-completion/blob/3039122fecf228e96174d23dc7a5dafa6bff2002/test/runLint#L68
- 
https://github.com/scop/bash-completion/blob/3039122fecf228e96174d23dc7a5dafa6bff2002/test/runLint#L71
- 
https://github.com/akinomyoga/ble.sh/blob/b72d78a97e6867bbf43de6a645dd6e387525443f/make_command.sh#L263
- 
https://github.com/akinomyoga/ble.sh/blob/b72d78a97e6867bbf43de6a645dd6e387525443f/make_command.sh#L267
- 
https://github.com/akinomyoga/ble.sh/blob/b72d78a97e6867bbf43de6a645dd6e387525443f/make_command.sh#L293
- 
https://github.com/akinomyoga/ble.sh/blob/b72d78a97e6867bbf43de6a645dd6e387525443f/make_command.sh#L339
- 
https://github.com/akinomyoga/ble.sh/blob/b72d78a97e6867bbf43de6a645dd6e387525443f/make_command.sh#L356

"${var:-'$bar'}" seems to be detected by shellcheck:

- https://www.shellcheck.net/wiki/SC2016

--
Koichi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]