]> git.saurik.com Git - apple/shell_cmds.git/blobdiff - sh/tests/execution/fork2.0
shell_cmds-198.tar.gz
[apple/shell_cmds.git] / sh / tests / execution / fork2.0
diff --git a/sh/tests/execution/fork2.0 b/sh/tests/execution/fork2.0
new file mode 100644 (file)
index 0000000..62a2537
--- /dev/null
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+result=$(${SH} -c '(/bin/sleep 1)& sleep 0.1; ps -p $! -o comm=; kill $!')
+test "$result" = sleep || exit 1
+
+result=$(${SH} -c '{ trap "echo trapped" EXIT; (/usr/bin/true); } & wait')
+test "$result" = trapped || exit 1
+
+exit 0