Commit 979f04f
committed
fix(iperf): work around failglob with backslash in bash-5.0
In Bash 5.0, a backslash in an unquoted variable expansion $var
induces a pathname expansion, and the backslash is removed. In
addition, the execution fails when `shopt -s failglob` is set and
there are no filenames matching the pattern. The raw variable
expansion $var can also be subject to unexpected word splitting with a
custom IFS. One should store command words in an array or should
`eval` the command stored in a scalar variable. This PR uses an array
variable.
Note: This Bash behavior was required by the literal interpretation of
the POSIX wording. After Bash 5.0 implemented this literal
interpretation, a discussion on the POSIX interpretation arose.
Finally the POSIX wording was modified to match the behavior of Bash <
5.0. Then, the Bash behavior was reverted in Bash 5.1. For this
reason, this behavior of the pathname expansion is only observed in
Bash 5.0.1 parent 835be1c commit 979f04f
1 file changed
+6
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | | - | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
82 | | - | |
| 83 | + | |
83 | 84 | | |
84 | | - | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
0 commit comments