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