aboutsummaryrefslogtreecommitdiff
path: root/shell/ash_test
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash_test')
-rw-r--r--shell/ash_test/ash-misc/source_argv_and_shift.right4
-rwxr-xr-xshell/ash_test/ash-misc/source_argv_and_shift.tests12
2 files changed, 16 insertions, 0 deletions
diff --git a/shell/ash_test/ash-misc/source_argv_and_shift.right b/shell/ash_test/ash-misc/source_argv_and_shift.right
new file mode 100644
index 000000000..b15cc96e7
--- /dev/null
+++ b/shell/ash_test/ash-misc/source_argv_and_shift.right
@@ -0,0 +1,4 @@
+sourced_arg1:1
+arg1:
+sourced_arg1:a
+arg1:1
diff --git a/shell/ash_test/ash-misc/source_argv_and_shift.tests b/shell/ash_test/ash-misc/source_argv_and_shift.tests
new file mode 100755
index 000000000..66353f3d7
--- /dev/null
+++ b/shell/ash_test/ash-misc/source_argv_and_shift.tests
@@ -0,0 +1,12 @@
+echo 'echo sourced_arg1:$1' >sourced1
+echo 'shift' >>sourced1
+
+set -- 1
+. ./sourced1
+echo arg1:$1
+
+set -- 1
+. ./sourced1 a
+echo arg1:$1
+
+rm sourced1