summaryrefslogtreecommitdiffstats
path: root/bin/rm
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>1996-03-07 23:26:59 +0000
committerwosch <wosch@FreeBSD.org>1996-03-07 23:26:59 +0000
commit424382b97890577a454834fbcd5a2d900c4d751f (patch)
treef29f223272fa037c1f01771afda157cb35465ee1 /bin/rm
parenta3bec8558ea310616fbfcd1621a12aeff52aff1e (diff)
downloadFreeBSD-src-424382b97890577a454834fbcd5a2d900c4d751f.zip
FreeBSD-src-424382b97890577a454834fbcd5a2d900c4d751f.tar.gz
fix usage string
respond `Y' is equal to `y' Add a note how to delete file name with beginning `-'
Diffstat (limited to 'bin/rm')
-rw-r--r--bin/rm/rm.118
-rw-r--r--bin/rm/rm.c6
2 files changed, 20 insertions, 4 deletions
diff --git a/bin/rm/rm.1 b/bin/rm/rm.1
index 2e523b9..693c1cf 100644
--- a/bin/rm/rm.1
+++ b/bin/rm/rm.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)rm.1 8.2 (Berkeley) 4/18/94
-.\" $Id$
+.\" $Id: rm.1,v 1.2 1994/09/24 02:57:00 davidg Exp $
.\"
.Dd April 18, 1994
.Dt RM 1
@@ -118,10 +118,26 @@ removed.
If an error occurs,
.Nm rm
exits with a value >0.
+.Sh NOTE
+.Nm rm
+use
+.Xr getopt 3
+parsing routine. Getopt accept a
+.Sq Li --
+argument, which stop reading options, anything after this
+is not an option.
+So
+.Nm rm
+handle files whose names begins with a
+.Sq Li - .
+Example:
+
+``$ rm -- -filename''.
.Sh SEE ALSO
.Xr rmdir 1 ,
.Xr unlink 2 ,
.Xr fts 3 ,
+.Xr getopt 3 ,
.Xr symlink 7
.Sh BUGS
The
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index fd3dd0c..a58427d 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: rm.c,v 1.9 1996/02/19 00:44:02 wosch Exp $
+ * $Id: rm.c,v 1.10 1996/02/19 05:57:22 pst Exp $
*/
#ifndef lint
@@ -377,7 +377,7 @@ check(path, name, sp)
first = ch = getchar();
while (ch != '\n' && ch != EOF)
ch = getchar();
- return (first == 'y');
+ return (first == 'y' || first == 'Y');
}
#define ISDOT(a) ((a)[0] == '.' && (!(a)[1] || ((a)[1] == '.' && !(a)[2])))
@@ -409,6 +409,6 @@ void
usage()
{
- (void)fprintf(stderr, "usage: rm [-dfiPRr] file ...\n");
+ (void)fprintf(stderr, "usage: rm [-f | -i] [-dPRr] file ...\n");
exit(1);
}
OpenPOWER on IntegriCloud