[Assorted-commits] SF.net SVN: assorted: [318] sandbox/trunk/src/bash/subprocess.bash
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-02-04 19:01:24
|
Revision: 318 http://assorted.svn.sourceforge.net/assorted/?rev=318&view=rev Author: yangzhang Date: 2008-02-04 11:01:29 -0800 (Mon, 04 Feb 2008) Log Message: ----------- added subprocess bash test Added Paths: ----------- sandbox/trunk/src/bash/subprocess.bash Added: sandbox/trunk/src/bash/subprocess.bash =================================================================== --- sandbox/trunk/src/bash/subprocess.bash (rev 0) +++ sandbox/trunk/src/bash/subprocess.bash 2008-02-04 19:01:29 UTC (rev 318) @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# vim:et:sw=2:ts=2 + +# The subproc (sleep) always lives. + +# Try passing something as an arg, which causes us to exit immediately without +# waiting for the subprocess to finish; notice the subproc lives. + +# Try launching this in bg (without args), and killing it; notice subproc +# lives. + +# Try ctrl-c on this while it's in the fg (without args); notice the subproc +# lives (unlike in python). + +# Try launching this in bg and `kill -s int` on it; notice the subproc lives. + +sleep 5 & + +pid=$! +if (( $# == 0 )) +then wait $pid +fi + +ps $pid Property changes on: sandbox/trunk/src/bash/subprocess.bash ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |