summaryrefslogtreecommitdiff
path: root/shell/bin/chmod.php
blob: ca66f56d808f91667799fada5489cfe93448a83b (plain)
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));
		}
	}
}