#! /usr/local/bin/php $n ? $m[1] : $n; } // At this point $n should be the highest image in the list // Make it one higher $n++; // Name of our file, with absolute path and all // eg: /home/joe/scrots/freebsd9.jpg $file = $path.'freebsd'.$n.'.jpg'; // The scrot command saves the screenshot to the filename `{$binpath}scrot $file`; // This command brings up a GUI notification message with the filename as the message `{$binpath}xmessage $file`; // Echo out the absolute path so a script can read it as the result of this script echo $file;