1 2 3 4 5 6 7 8 9 10 11 12 13
<?php function main($args) { $me = array_shift($args); if (count($args)<2) { echo $me.': usage: '.$me.' MODE FILE1 [FILE2 [FILE2]]'."\n"; return 1; } else { $mode = array_shift($args); foreach ($args as $file) { chmod($file,octdec($mode)); } } }