| 1 |
.TH REVPATH 1 __vendorversion__ |
| 2 |
.SH NAME |
| 3 |
revpath \- generate a relative path that can be used to undo a change-directory |
| 4 |
.SH SYNOPSIS |
| 5 |
.B revpath |
| 6 |
.I path |
| 7 |
.SH DESCRIPTION |
| 8 |
The |
| 9 |
.I revpath |
| 10 |
program prints out a relative path that is the ``reverse'' or ``inverse'' of |
| 11 |
.IR path . |
| 12 |
Start with two directories |
| 13 |
.I top |
| 14 |
and |
| 15 |
.IR bottom , |
| 16 |
with the latter below the former, and |
| 17 |
.I path |
| 18 |
is the location of |
| 19 |
.I bottom |
| 20 |
relative to |
| 21 |
.IR top . |
| 22 |
The output of |
| 23 |
.I revpath |
| 24 |
is the location of |
| 25 |
.I top |
| 26 |
relative to |
| 27 |
.IR bottom . |
| 28 |
The resulting path contains a trailing `/' character when the result is |
| 29 |
non-trivial. |
| 30 |
If |
| 31 |
.I path |
| 32 |
is equivalent to `.', the resulting output is empty. |
| 33 |
If |
| 34 |
.I path |
| 35 |
is invalid in some way (e.g., doesn't represent the path to a subdirectory) |
| 36 |
the output is also empty and no error messages are ever generated. |
| 37 |
.SH DIAGNOSTICS |
| 38 |
There are no diagnostics. Error conditions are silently ignored, and the |
| 39 |
exit status is always 0. |
| 40 |
.SH BUGS |
| 41 |
It isn't possible to reverse arbitrary relative paths. |
| 42 |
If any path element between the two end points of |
| 43 |
.I path |
| 44 |
is a symbolic link, the results will probably be incorrect. |