butch scripts use readlink -f which is not posix #575

Open
opened 5 years ago by rofl0r · 1 comments
rofl0r commented 5 years ago (Migrated from github.com)
Owner

... so it may currently not be used on Mac OS X, and maybe some BSDs...

TODO: find portable way to achieve the same

readlink_f() {
readlink "$1" || printf "%s\n" "$1" | sed -e 's,\\,/,g'
}

this possible candidate works for the cases where readlink doesn't return anything, and the program is in $PATH, but not for the case of relative symlinks: e.g.

$ readlink /bin/butch
../opt/sabotage-core/bin/butch
... so it may currently not be used on Mac OS X, and maybe some BSDs... TODO: find portable way to achieve the same ```sh readlink_f() { readlink "$1" || printf "%s\n" "$1" | sed -e 's,\\,/,g' } ``` this possible candidate works for the cases where readlink doesn't return anything, and the program is in $PATH, but not for the case of relative symlinks: e.g. ```sh $ readlink /bin/butch ../opt/sabotage-core/bin/butch ```
rofl0r commented 5 years ago (Migrated from github.com)
Owner

hoping that @nero soon completes his https://github.com/nero/realpath.sh ..

hoping that @nero soon completes his https://github.com/nero/realpath.sh ..
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: sabotage-linux/sabotage#575
Loading…
There is no content yet.