I don't want to resolve any links in the path.
Well then, I don't understand what you mean because AFAICS realpath does not do that*. If you can provide an SSCCE (ideally in the form of a test) showing precisely what output you want for a given input and how realpath fails in that regard perhaps we can guide you further.
* Update: yes, it does do that - see replies.
🦛
In reply to Re^3: How to get the unique canonical path of a given path?
by hippo
in thread How to get the unique canonical path of a given path?
by ovedpo15
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |