Summary: | app-shells/bash: changes to handling of array subscripts in math context raise backward compatibility concerns | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | kfm <kfm> |
Component: | Current packages | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | http://mywiki.wooledge.org/BashPitfalls#A.28.28_hash.5B.24key.5D.2B-.2B-_.29.29 | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=881383 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 881379 |
Description
kfm
2022-11-15 12:34:48 UTC
There is another workaround. As observed by the BashPitfalls page, let is unaffected because "its arguments are passed directly to arith.c without the parser mangling the expression unpredictably." Again, taking the unique lines program as an example, it could be written as follows. declare -A seen while read -r; do if ! let 'seen[$REPLY]++'; then printf '%s\n' "$REPLY" fi done I think that it's improbable that the behaviour of let will change any time soon. That being said, who can ever tell what Chet is going to do next. So far, I have reviewed the following projects. - portage - the ::gentoo repo - the ::haskell repo - the ::guru repo No changes are required in any of these at the current time. I think we're okay here then accordingly, and it looks like nothing is going to change. |