Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapper uses readlink -f which is not supported on all versions of macOS #28

Open
johnsonjh opened this issue Jul 27, 2022 · 3 comments

Comments

@johnsonjh
Copy link

The eatmydata wrapper uses readlink -f which is not supported on all versions of macOS - the simplest workaround is to use readlink from coreutils.

I will take a look further at the usage in the script and see if an alternative that does not require any dependencies could be possible unless someone beats me to it.

@johnsonjh
Copy link
Author

I don't know the exact versions where -f is supported, but the failure noted was from Homebrew's CI on ARM64 macOS 11.

39DE0B5C-57C4-4AAC-A1FD-24BFDE469AEE

@johnsonjh
Copy link
Author

johnsonjh commented Jul 27, 2022

Perhaps realpath -e would work here.

As with readlink, since this is non-POSIX, I'd need to check if it's widely supported ...

@jjwatt
Copy link

jjwatt commented Jan 30, 2023

FYI, http://mywiki.wooledge.org/BashFAQ/029

tl;dr: You can use perl:

perl -le 'print readlink "/bin/sh"'

or find with printf %l:

$ find /bin/ -type l -printf '%p points to %l\n'
/bin/sh points to bash
/bin/bunzip2 points to bzip2

or write a custom function (that is a little gnarly--see the link for it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants