From 39761c00874b745fbe01ac8bd897450391f72589 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 2 Dec 2018 09:42:35 +0100 Subject: [PATCH] test: 04-word-at. --- check.sh | 1 + gash/script.scm | 4 ++-- test/04-echo-word-at.sh | 1 + test/04-echo-word-at.stdout | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 test/04-echo-word-at.sh create mode 100644 test/04-echo-word-at.stdout diff --git a/check.sh b/check.sh index 8ed8675..9a430d2 100755 --- a/check.sh +++ b/check.sh @@ -31,6 +31,7 @@ tests=' 04-echo-var 04-echo-equal +04-echo-word-at 05-assignment 05-assignment-echo diff --git a/gash/script.scm b/gash/script.scm index 8a2e226..d909a30 100644 --- a/gash/script.scm +++ b/gash/script.scm @@ -105,8 +105,8 @@ (run ast) 0)) (((? string?) ..1) (exec (append-map glob args))) - (((and (or (? string?)) c) ((and (? string?) a) ...)) - (exec (append-map glob (cons c a)))) + (((and (or (? string?)) c) ... ((and (? string?) a) ...)) + (apply command (append c a))) (_ (exec (append-map glob args))))) (define (glob? pattern) diff --git a/test/04-echo-word-at.sh b/test/04-echo-word-at.sh new file mode 100644 index 0000000..b3ba18e --- /dev/null +++ b/test/04-echo-word-at.sh @@ -0,0 +1 @@ +echo command $@ diff --git a/test/04-echo-word-at.stdout b/test/04-echo-word-at.stdout new file mode 100644 index 0000000..6253d76 --- /dev/null +++ b/test/04-echo-word-at.stdout @@ -0,0 +1 @@ +command -s --long file0 file1