summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJared Yanovich <jaredy@cvs.openbsd.org>2004-12-17 00:36:08 +0000
committerJared Yanovich <jaredy@cvs.openbsd.org>2004-12-17 00:36:08 +0000
commitc6b5d9d78163a4af46fbe6f529821d338a7b55ef (patch)
tree7566d70153369569071a62907a4dbe95b8ddf729 /bin
parenta1e3a8f54569bd16f10e9fb57f4dcd202a1c2036 (diff)
sync usage
manpage: - indent examples - document exit status ok jmc
Diffstat (limited to 'bin')
-rw-r--r--bin/ln/ln.149
-rw-r--r--bin/ln/ln.c9
2 files changed, 34 insertions, 24 deletions
diff --git a/bin/ln/ln.1 b/bin/ln/ln.1
index 8cc18115ac3..5d29f9b9659 100644
--- a/bin/ln/ln.1
+++ b/bin/ln/ln.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ln.1,v 1.20 2003/06/02 23:32:08 millert Exp $
+.\" $OpenBSD: ln.1,v 1.21 2004/12/17 00:36:07 jaredy Exp $
.\" $NetBSD: ln.1,v 1.10 1995/07/25 19:37:04 jtc Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
@@ -45,8 +45,8 @@
.Ar source_file
.Op Ar target_file
.Nm ln
-.Op Fl fhns
-.Ar source_file ...
+.Op Fl fs
+.Ar source_file ...\&
.Op Ar target_dir
.Sh DESCRIPTION
The
@@ -122,27 +122,32 @@ makes links in
.Ar target_dir
to all the named source files.
The links made will have the same name as the files being linked to.
-.Sh EXAMPLES
-.Li # ln -s /var/www /home/www
.Pp
-Creates a symbolic link named
+The
+.Nm
+utility exits 0 on success or >0 if an error occurred.
+.Sh EXAMPLES
+Create a symbolic link named
.Pa /home/www
-and points it to
-.Pa /var/www .
+and point it to
+.Pa /var/www :
.Pp
-.Li # ln /usr/local/bin/fooprog-1.0 /usr/local/bin/fooprog
+.Dl # ln -s /var/www /home/www
.Pp
Hard link
.Pa /usr/local/bin/fooprog
to file
-.Pa /usr/local/bin/fooprog-1.0 .
+.Pa /usr/local/bin/fooprog-1.0 :
.Pp
-As an exercise, try the following commands:
+.Dl # ln /usr/local/bin/fooprog-1.0 /usr/local/bin/fooprog
.Pp
-.D1 Ic $ ls -i /bin/[
-.D1 Li 11553 /bin/[
-.D1 Ic $ ls -i /bin/test
-.D1 Li 11553 /bin/test
+As an exercise, try the following commands:
+.Bd -literal -offset indent
+$ ls -i /bin/[
+11553 /bin/[
+$ ls -i /bin/test
+11553 /bin/test
+.Ed
.Pp
Note that both files have the same inode; that is,
.Pa /bin/[
@@ -155,16 +160,20 @@ may be invoked from shell scripts, for example, using the
.Li "if [ ]"
construct.
.Pp
-.Li "$ mkdir bar baz; ln -s bar foo; ln -shf baz foo"
-.Pp
-The second call to
+In the next example, the second call to
.Nm
removes the original
.Pa foo
and creates a replacement pointing to
-.Pa baz .
+.Pa baz :
+.Bd -literal -offset indent
+$ mkdir bar baz
+$ ln -s bar foo
+$ ln -shf baz foo
+.Ed
+.Pp
Without the
-.Ar -h
+.Fl h
option, this would instead leave
.Pa foo
pointing to
diff --git a/bin/ln/ln.c b/bin/ln/ln.c
index 71ff79ae7c0..180c514f265 100644
--- a/bin/ln/ln.c
+++ b/bin/ln/ln.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ln.c,v 1.10 2003/06/02 23:32:08 millert Exp $ */
+/* $OpenBSD: ln.c,v 1.11 2004/12/17 00:36:07 jaredy Exp $ */
/* $NetBSD: ln.c,v 1.10 1995/03/21 09:06:10 cgd Exp $ */
/*
@@ -40,7 +40,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
#else
-static const char rcsid[] = "$OpenBSD: ln.c,v 1.10 2003/06/02 23:32:08 millert Exp $";
+static const char rcsid[] = "$OpenBSD: ln.c,v 1.11 2004/12/17 00:36:07 jaredy Exp $";
#endif
#endif /* not lint */
@@ -166,7 +166,8 @@ usage(void)
extern char *__progname;
(void)fprintf(stderr,
- "usage: %s [-fhns] file1 file2\n\tln [-fs] file ... directory\n",
- __progname);
+ "usage: %s [-fhns] file1 file2\n"
+ " %s [-fs] file ... directory\n",
+ __progname, __progname);
exit(1);
}