#!/bin/csh ############################################################### # This script pauses the currently-playing sox program, which # is what the 'play' command calls. ############################################################## # The -C tells it to list processes by command. The -o sets # the output format, with the = meaning no header. set jobid = `ps -C sox -o pid=` if ( $jobid > 0 ) then kill -STOP $jobid >& /dev/null set directory = `musicbox_state_directory.txt` touch "$directory"/paused endif exit 0