REVPATH(1)
okay so, welcome to the REVPATH(1) page from the General Commands Manual π β yes, the manual name is folded up in here like a little note π. This one is short, and itβs giving βsmall but mightyβ energy.
π¦ NAME π¦
revpath β generate a relative path that can be used to undo a change-directory
β¨ SYNOPSIS β¨
revpath path
π DESCRIPTION π
The revpath program prints out a relative path that is the βreverseβ or βinverseβ of path. Picture two directories, top and bottom, with the latter below the former, and path is the location of bottom relative to top. The output of revpath is the location of top relative to bottom.
The resulting path contains a trailing / character when the result is non-trivial. If path is equivalent to ., the resulting output is empty. If path is invalid in some way (e.g., doesn't represent the path to a subdirectory) the output is also empty and no error messages are ever generated.
π DIAGNOSTICS π
There are no diagnostics. Error conditions are silently ignored, and the exit status is always 0. fr fr β no drama, no messages, no exit-code chaos π.
π BUGS π
It isn't possible to reverse arbitrary relative paths. If any path element between the two end points of path is a symbolic link, the results will probably be incorrect. big yikes, handle with care π.
xoxo, your local Unix bestie π β this page is from imake 1.0.11, dated 1999-01-02. π«Ά
π¦ where this page comes from
- alpine 3.24: imake-doc 1.0.11-r0 Β· custom
- arch rolling: imake 1.0.11-1 Β· MIT-open-group AND HPND
- nixos 26.05: imake 1.0.11
- nixpkgs unstable: imake 1.0.11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms