a531865fe5
1) Properly document e, f and m-flags in the manpage. 2) Clear up the code for the m-flag-handling. Add idiomatic '/'-path-traversal as already seen in mkdir(1). 3) Unwrap the SWAP_BUF()-macro. 4) BUGFIX: Actually handle the f-flag properly. Only resolve the dirname and append the basename later. 5) Use fputs() instead of printf("%s", ...).
34 lines
636 B
Groff
34 lines
636 B
Groff
.Dd March 20, 2015
|
|
.Dt READLINK 1
|
|
.Os sbase
|
|
.Sh NAME
|
|
.Nm readlink
|
|
.Nd print symbolic link target or canonical file name
|
|
.Sh SYNOPSIS
|
|
.Nm
|
|
.Op Fl e | Fl f | Fl m
|
|
.Op Fl n
|
|
.Ar path
|
|
.Sh DESCRIPTION
|
|
.Nm
|
|
writes the target of
|
|
.Ar path ,
|
|
if it is a symbolic link, to stdout.
|
|
If not,
|
|
.Nm
|
|
exits with a non-zero return value.
|
|
.Sh OPTIONS
|
|
.Bl -tag -width Ds
|
|
.It Fl e | Fl f | Fl m
|
|
Canonicalize
|
|
.Ar name ,
|
|
which needn't be a symlink,
|
|
by recursively following every symlink in its path components.
|
|
All | All but the last | No path components must exist.
|
|
.It Fl n
|
|
Do not print the terminating newline.
|
|
.El
|
|
.Sh SEE ALSO
|
|
.Xr readlink 2 ,
|
|
.Xr realpath 3
|