diff --git a/check.sh b/check.sh index e8d3a69..8b735ac 100755 --- a/check.sh +++ b/check.sh @@ -75,6 +75,7 @@ tests=" 41-dot 50-iohere +50-iohere-builtin 50-redirect 50-redirect-space 50-redirect-in diff --git a/gash/script.scm b/gash/script.scm index 1320803..5a39f7b 100644 --- a/gash/script.scm +++ b/gash/script.scm @@ -188,6 +188,8 @@ #'(with-output-to-file file-name (command word ...))) ((_ word ... (io-redirect "2" (io-file ">" file-name))) #'(with-error-to-file file-name (command word ...))) + ((_ word ... (io-redirect (io-here "<<" (io-here-document string)))) + #'(pipeline (cut display string) (command word ...))) ((_ word ...) #'(exec-command word ...))))) diff --git a/test/50-iohere-builtin.sh b/test/50-iohere-builtin.sh new file mode 100644 index 0000000..c6c1126 --- /dev/null +++ b/test/50-iohere-builtin.sh @@ -0,0 +1,3 @@ +\cat <