fix usage string

respond `Y' is equal to `y'

Add a note how to delete file name with beginning `-'
This commit is contained in:
Wolfram Schneider 1996-03-07 23:26:59 +00:00
parent c8f22f0e34
commit b0205aff7f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14409
2 changed files with 20 additions and 4 deletions

View File

@ -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

View File

@ -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);
}