summaryrefslogtreecommitdiff
path: root/shell/bin/cat.php
blob: 8778f221297e802e220885143fea1f394621824c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
class p_cat extends prog {
	public static function main($args, $env) {
		$me = array_shift($args);
		if (count($args)==0) { $args = array('-'); }
		foreach ($args as $file) {
			if ( ($file=='-') || ($file=='/dev/stdin') ) {
				echo $_POST['stdin'];
			} else {
				echo htmlentities(file_get_contents($file));
			}
		}
	}
}