A 3 line example with 3 bugs.

1.  destination and destination_path should be the same.
2.  source_file doesn't have to be a file.
3.  mv will also unlink a directory, ala rm -d.

Index: mv.1
===================================================================
RCS file: /home/tedu/cvs/src/bin/mv/mv.1,v
retrieving revision 1.26
diff -u -r1.26 mv.1
--- mv.1        3 Sep 2010 09:53:20 -0000       1.26
+++ mv.1        26 Dec 2010 05:35:57 -0000
@@ -117,9 +117,9 @@
 to accomplish the move.
 The effect is equivalent to:
 .Bd -literal -offset indent
-$ rm -f destination_path && \e
-    cp -PRp source_file destination && \e
-    rm -rf source_file
+$ rm -df destination && \e
+    cp -PRp source destination && \e
+    rm -rf source
 .Ed
 .Sh EXIT STATUS
 .Ex -std mv

Reply via email to