Added verbose extension and updated manual pages. Changes approved by Klaus Klein.
This commit is contained in:
parent
bf746f0aa4
commit
1f6c14f0d6
17
bin/ln/ln.1
17
bin/ln/ln.1
@ -1,4 +1,4 @@
|
|||||||
.\" $NetBSD: ln.1,v 1.16 2002/09/25 15:18:39 wiz Exp $
|
.\" $NetBSD: ln.1,v 1.17 2002/12/26 21:37:17 jrf Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1980, 1990, 1993
|
.\" Copyright (c) 1980, 1990, 1993
|
||||||
.\" The Regents of the University of California. All rights reserved.
|
.\" The Regents of the University of California. All rights reserved.
|
||||||
@ -36,7 +36,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" @(#)ln.1 8.2 (Berkeley) 12/30/93
|
.\" @(#)ln.1 8.2 (Berkeley) 12/30/93
|
||||||
.\"
|
.\"
|
||||||
.Dd October 14, 2000
|
.Dd December 26, 2002
|
||||||
.Dt LN 1
|
.Dt LN 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -44,11 +44,11 @@
|
|||||||
.Nd make links
|
.Nd make links
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl fhns
|
.Op Fl fhnsv
|
||||||
.Ar source_file
|
.Ar source_file
|
||||||
.Op Ar target_file
|
.Op Ar target_file
|
||||||
.Nm ""
|
.Nm ""
|
||||||
.Op Fl fhns
|
.Op Fl fhnsv
|
||||||
.Ar source_file ... target_dir
|
.Ar source_file ... target_dir
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
The
|
The
|
||||||
@ -87,6 +87,10 @@ for compatibility with other
|
|||||||
implementations.
|
implementations.
|
||||||
.It Fl s
|
.It Fl s
|
||||||
Create a symbolic link.
|
Create a symbolic link.
|
||||||
|
.It Fl v
|
||||||
|
Cause
|
||||||
|
.Nm
|
||||||
|
to be verbose, showing files as they are processed.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
By default
|
By default
|
||||||
@ -146,6 +150,11 @@ The
|
|||||||
.Nm
|
.Nm
|
||||||
utility conforms to
|
utility conforms to
|
||||||
.St -p1003.2-92 .
|
.St -p1003.2-92 .
|
||||||
|
.Pp
|
||||||
|
The
|
||||||
|
.Fl v
|
||||||
|
option is an extension to
|
||||||
|
.St -p1003.2-92 .
|
||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
A
|
A
|
||||||
.Nm
|
.Nm
|
||||||
|
18
bin/mv/mv.1
18
bin/mv/mv.1
@ -1,4 +1,4 @@
|
|||||||
.\" $NetBSD: mv.1,v 1.18 2002/02/08 01:21:58 ross Exp $
|
.\" $NetBSD: mv.1,v 1.19 2002/12/26 21:37:17 jrf Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1989, 1990, 1993
|
.\" Copyright (c) 1989, 1990, 1993
|
||||||
.\" The Regents of the University of California. All rights reserved.
|
.\" The Regents of the University of California. All rights reserved.
|
||||||
@ -36,7 +36,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" @(#)mv.1 8.1 (Berkeley) 5/31/93
|
.\" @(#)mv.1 8.1 (Berkeley) 5/31/93
|
||||||
.\"
|
.\"
|
||||||
.Dd May 31, 1993
|
.Dd December 26, 2002
|
||||||
.Dt MV 1
|
.Dt MV 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -44,10 +44,10 @@
|
|||||||
.Nd move files
|
.Nd move files
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl fi
|
.Op Fl fiv
|
||||||
.Ar source target
|
.Ar source target
|
||||||
.Nm ""
|
.Nm ""
|
||||||
.Op Fl fi
|
.Op Fl fiv
|
||||||
.Ar source ... directory
|
.Ar source ... directory
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
In its first form, the
|
In its first form, the
|
||||||
@ -83,6 +83,10 @@ to write a prompt to standard error before moving a file that would
|
|||||||
overwrite an existing file.
|
overwrite an existing file.
|
||||||
If the response from the standard input begins with the character ``y'',
|
If the response from the standard input begins with the character ``y'',
|
||||||
the move is attempted.
|
the move is attempted.
|
||||||
|
.It Fl v
|
||||||
|
Cause
|
||||||
|
.Nm
|
||||||
|
to be verbose, showing files as they are processed.
|
||||||
.El
|
.El
|
||||||
The last of any
|
The last of any
|
||||||
.Fl f
|
.Fl f
|
||||||
@ -90,7 +94,6 @@ or
|
|||||||
.Fl i
|
.Fl i
|
||||||
options is the one which affects
|
options is the one which affects
|
||||||
.Nm Ns 's
|
.Nm Ns 's
|
||||||
behavior.
|
|
||||||
.Pp
|
.Pp
|
||||||
It is an error for any of the
|
It is an error for any of the
|
||||||
.Ar source
|
.Ar source
|
||||||
@ -138,3 +141,8 @@ The
|
|||||||
utility is expected to be
|
utility is expected to be
|
||||||
.St -p1003.2
|
.St -p1003.2
|
||||||
compatible.
|
compatible.
|
||||||
|
.Pp
|
||||||
|
The
|
||||||
|
.Fl v
|
||||||
|
option is an extension to
|
||||||
|
.St -p1003.2 .
|
||||||
|
26
bin/mv/mv.c
26
bin/mv/mv.c
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: mv.c,v 1.27 2001/09/16 21:53:55 wiz Exp $ */
|
/* $NetBSD: mv.c,v 1.28 2002/12/26 21:37:17 jrf Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1989, 1993, 1994
|
* Copyright (c) 1989, 1993, 1994
|
||||||
@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993, 1994\n\
|
|||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94";
|
static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: mv.c,v 1.27 2001/09/16 21:53:55 wiz Exp $");
|
__RCSID("$NetBSD: mv.c,v 1.28 2002/12/26 21:37:17 jrf Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ __RCSID("$NetBSD: mv.c,v 1.27 2001/09/16 21:53:55 wiz Exp $");
|
|||||||
|
|
||||||
#include "pathnames.h"
|
#include "pathnames.h"
|
||||||
|
|
||||||
int fflg, iflg;
|
int fflg, iflg, vflg;
|
||||||
int stdin_ok;
|
int stdin_ok;
|
||||||
|
|
||||||
int copy(char *, char *);
|
int copy(char *, char *);
|
||||||
@ -88,7 +88,7 @@ main(int argc, char *argv[])
|
|||||||
setprogname(argv[0]);
|
setprogname(argv[0]);
|
||||||
(void)setlocale(LC_ALL, "");
|
(void)setlocale(LC_ALL, "");
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "if")) != -1)
|
while ((ch = getopt(argc, argv, "ifv")) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'i':
|
case 'i':
|
||||||
fflg = 0;
|
fflg = 0;
|
||||||
@ -98,6 +98,9 @@ main(int argc, char *argv[])
|
|||||||
iflg = 0;
|
iflg = 0;
|
||||||
fflg = 1;
|
fflg = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'v':
|
||||||
|
vflg = 1;
|
||||||
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
@ -210,8 +213,11 @@ do_move(char *from, char *to)
|
|||||||
* message to standard error, and do nothing more with the
|
* message to standard error, and do nothing more with the
|
||||||
* current source file...
|
* current source file...
|
||||||
*/
|
*/
|
||||||
if (!rename(from, to))
|
if (!rename(from, to)) {
|
||||||
|
if (vflg)
|
||||||
|
printf("%s -> %s\n", from, to);
|
||||||
return (0);
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
if (errno != EXDEV) {
|
if (errno != EXDEV) {
|
||||||
warn("rename %s to %s", from, to);
|
warn("rename %s to %s", from, to);
|
||||||
@ -313,6 +319,10 @@ err: if (unlink(to))
|
|||||||
warn("%s: remove", from);
|
warn("%s: remove", from);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vflg)
|
||||||
|
printf("%s -> %s\n", from, to);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,7 +332,7 @@ copy(char *from, char *to)
|
|||||||
int pid, status;
|
int pid, status;
|
||||||
|
|
||||||
if ((pid = vfork()) == 0) {
|
if ((pid = vfork()) == 0) {
|
||||||
execl(_PATH_CP, "mv", "-PRp", from, to, NULL);
|
execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", from, to, NULL);
|
||||||
warn("%s", _PATH_CP);
|
warn("%s", _PATH_CP);
|
||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
@ -363,8 +373,8 @@ copy(char *from, char *to)
|
|||||||
void
|
void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
(void)fprintf(stderr, "usage: %s [-fi] source target\n"
|
(void)fprintf(stderr, "usage: %s [-fiv] source target\n"
|
||||||
" %s [-fi] source ... directory\n", getprogname(),
|
" %s [-fiv] source ... directory\n", getprogname(),
|
||||||
getprogname());
|
getprogname());
|
||||||
exit(1);
|
exit(1);
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
|
Loading…
Reference in New Issue
Block a user