add parameter expansion, arithmetic, set -e/-x/pipefail, trap, eval, exec
- ${#v}, ${v#p} ${v##p} ${v%p} ${v%%p}, ${v/p/r} ${v//p/r} ${v/#p/r}
${v/%p/r}, ${v:off:len}, ${v-w} ${v:=w} ${v:+w} ${v:?msg}; nested ${}
- arithmetic expansion $((...)) with the C operators, ** and assignments
- set -e, set -x, set -o pipefail (also as gosh options, passed on to
subshells); set shows variables, set -o the options
- trap for EXIT and signals; scripts with an EXIT trap run it on
SIGINT/SIGTERM/SIGHUP too
- eval, exec (also exec > file without a command), $!, wait pid
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f66cf538c0
commit
1f507f6562
20 files changed
+2408
-93
No files matched your search
+1
-2
@@ -94,8 +94,7 @@ func TestExecInput_CommandSubstitution(t *testing.T) {
|
||||
}
|
||||
|
||||
for input, wantErr := range map[string]string{
|
||||
"echo $(echo a": "syntax error: unexpected end of input",
|
||||
"echo $((1 + 2))": "invalid input: arithmetic expansion $((...)) is not supported",
|
||||
"echo $(echo a": "syntax error: unexpected end of input",
|
||||
} {
|
||||
if err := execInput(input); err == nil || err.Error() != wantErr {
|
||||
t.Errorf("%q: error %v, want %q", input, err, wantErr)
|
||||
|
||||
Reference in new issue
Block a user