diff --git a/gash/commands/sed.scm b/gash/commands/sed.scm index ab8b980..6e7a6e1 100644 --- a/gash/commands/sed.scm +++ b/gash/commands/sed.scm @@ -107,6 +107,8 @@ (define (execute-function function str) (match function + (('begin . commands) + (execute-commands commands str)) (('s pattern replacement flags) (substitute str pattern replacement flags)) (_ (error "SED: unsupported function" function)))) diff --git a/test/100-sed-command-list.sh b/test/100-sed-command-list.sh new file mode 100644 index 0000000..b3d918e --- /dev/null +++ b/test/100-sed-command-list.sh @@ -0,0 +1,4 @@ +input='foo +bar' + +echo "$input" | \sed '/foo/ { s/foo/baz/ s/baz/bar/ } s/bar/baz/' diff --git a/test/100-sed-command-list.stdout b/test/100-sed-command-list.stdout new file mode 100644 index 0000000..1f55335 --- /dev/null +++ b/test/100-sed-command-list.stdout @@ -0,0 +1,2 @@ +baz +baz