diff --git a/Makefile.am b/Makefile.am index b419d0c..7fa633a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -210,7 +210,8 @@ FULL_TESTS = \ tests/50-redirect-in.sh \ tests/50-redirect-append.sh \ tests/50-redirect-pipe.sh \ - tests/50-redirect-merge.sh \ + tests/50-redirect-sed.sh \ + tests/50-redirect-space.sh \ tests/50-redirect-in-out.sh \ tests/60-function.sh \ tests/60-function-at.sh \ @@ -223,6 +224,7 @@ FULL_TESTS = \ tests/70-slash.sh \ tests/70-slash-string.sh \ tests/70-slash-string-slash.sh \ + tests/100-cd.sh \ tests/100-cd-foo.sh \ tests/100-test.sh \ tests/100-test-file.sh \ @@ -247,10 +249,7 @@ XFAIL_TESTS = \ # that pass or fail based on environmental # factors. BROKEN_TESTS = \ - tests/10-if-redirect.sh \ - tests/50-redirect-sed.sh \ - tests/50-redirect-space.sh \ - tests/100-cd.sh + tests/50-redirect-merge.sh EXTRA_DIST = \ scripts/gash.in diff --git a/gash/environment.scm b/gash/environment.scm index 7239def..2e31f8b 100644 --- a/gash/environment.scm +++ b/gash/environment.scm @@ -108,7 +108,9 @@ (alist->hash-table (map (match-lambda ((name . value) `(,name . ,(vector value #t #f)))) - (append `(("PWD" . ,(initial-pwd env))) + (append `(("PWD" . ,(initial-pwd env)) + ("SHELL" . ,(car (command-line))) + ("SHELLOPTS" . "")) env))))) (define *variables* (initial-variables)) diff --git a/tests/100-cd.sh b/tests/100-cd.sh index 16911ea..1817731 100644 --- a/tests/100-cd.sh +++ b/tests/100-cd.sh @@ -1,2 +1,2 @@ -cd /bin +cd /tmp pwd diff --git a/tests/100-cd.stdout b/tests/100-cd.stdout index 5e56e04..ceeb05b 100644 --- a/tests/100-cd.stdout +++ b/tests/100-cd.stdout @@ -1 +1 @@ -/bin +/tmp diff --git a/tests/50-redirect-in-out.sh b/tests/50-redirect-in-out.sh index 7d81744..6aa8934 100644 --- a/tests/50-redirect-in-out.sh +++ b/tests/50-redirect-in-out.sh @@ -1,3 +1,3 @@ -cat < tests/data/foo > bar -cat bar -rm bar +cat < tests/data/foo > /tmp/bar$$ +cat /tmp/bar$$ +rm /tmp/bar$$ diff --git a/tests/50-redirect-sed.sh b/tests/50-redirect-sed.sh index f66236a..ee22797 100644 --- a/tests/50-redirect-sed.sh +++ b/tests/50-redirect-sed.sh @@ -1,5 +1,6 @@ +unset DESTDIR sed \ - -e "s,^#! /bin/sh,#! /bin/gash," \ + -e "s,^#! /bin/sh,#! /bin/GASH," \ tests/data/diff.scm > $DESTDIR/tmp/diff.scm cat $DESTDIR/tmp/diff.scm rm $DESTDIR/tmp/diff.scm diff --git a/tests/50-redirect-sed.stdout b/tests/50-redirect-sed.stdout index 800bdd8..bfc05fe 100644 --- a/tests/50-redirect-sed.stdout +++ b/tests/50-redirect-sed.stdout @@ -1,3 +1,3 @@ -#! /bin/gash +#! /bin/GASH !# diff --git a/tests/50-redirect-space.sh b/tests/50-redirect-space.sh index fe40da0..7451564 100644 --- a/tests/50-redirect-space.sh +++ b/tests/50-redirect-space.sh @@ -1,3 +1,3 @@ -echo foo > bar -cat bar -rm bar +echo foo > /tmp/bar$$ +cat /tmp/bar$$ +rm /tmp/bar$$ diff --git a/tests/50-redirect.sh b/tests/50-redirect.sh index da5cff4..6aaecd9 100644 --- a/tests/50-redirect.sh +++ b/tests/50-redirect.sh @@ -1,3 +1,3 @@ -echo foo 1>./bar -cat bar -rm bar +echo foo 1>/tmp/bar$$ +cat /tmp/bar$$ +rm /tmp/bar$$ diff --git a/tests/data/diff.scm b/tests/data/diff.scm index c7efd07..bfc05fe 100644 --- a/tests/data/diff.scm +++ b/tests/data/diff.scm @@ -1,3 +1,3 @@ -#! /bin/sh +#! /bin/GASH !#