Hey Harald On Mon, 2022-11-21 at 13:08 +0000, Harald van Dijk wrote: > > This is intentionally accepted, like all non-standard > substitutions, during parsing, but is supposed to raise a > substitution > error at runtime, so that scripts can do > > if shell_supports_subst; then > echo ${var//a/b} > else > echo $var | sed s/a/b/g > fi > > Parsing this if statement requires parsing both sides of the branch, > even ${var//a/b} will never be evaluated. Well, while I can understand the merit of this... it may also have some drawbacks. > Actually performing this substitution should result in an error: > > $ dash -c 'echo ${$//1/2}' > dash: 1: Bad substitution It does here, too. > What the intended behaviour here is though, is unclear. The > substitution > containing ${...//...} is evaluated but the ${...//...} is skipped > because $restrict_path_list is unset. In the original script, it may be set. I just shortened it. > Fixing this so it produces "Bad substitution" should be easy, almost > trivial. I, personally, would like that anyway better. Conditionally choosing the variant of shell command language during runtime seems quite fragile. I'd rather see straight away, that I use something non-supported. Is there some bugtracker for dash, so that it doesn't get forgotten? Thanks, Chris.