diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-11-27 11:23:55 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-11-27 11:23:55 -0500 |
commit | fb0380f48203a11584773f3db335eaadd9cc6fdf (patch) | |
tree | 98f7eb36ed8a3ec99c1cba5c9c0742af8931783b /shell/bin/mv.php | |
parent | 3d6790614bb0dc776e02a95835e5c274263d1d1a (diff) |
This zip file was identified as ltshell-3.5.zip
Diffstat (limited to 'shell/bin/mv.php')
-rw-r--r-- | shell/bin/mv.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/shell/bin/mv.php b/shell/bin/mv.php new file mode 100644 index 0000000..8fc35cd --- /dev/null +++ b/shell/bin/mv.php @@ -0,0 +1,22 @@ +<?php +class p_mv extends prog { + public static main($args, $env) { + $me = array_shift($args); + if (count($args)>2) { + $dest = array_pop($args); + if (!is_dir($dest) { + echo $me.': dest must be a directory: `'.$dest."'\n"; + return 1; + } + foreach ($args as $src) { + rename($src,$dest.'/'.basename($src)); + } + } elseif (count($args)==2) { + rename($args[0],$args[1]); + } else { + echo 'Usage: '.$me." SOURCE [SOURCE2 [SOURCE3 ...]] DEST\n"; + return 1; + } + } +} + |