In article <
201707090...@kylheku.com>,
Kaz Kylheku <
686-67...@kylheku.com> wrote:
>On 2017-07-09, Hongyi Zhao <
hongy...@gmail.com> wrote:
>> On Wed, 11 Feb 2015 13:06:39 +0000, Casper H.S. Dik wrote:
>>
>>> realpath(1) which is part of GNU coreutils.
...
>> # `readlink -f` won't work on Mac, this hack should work on all systems.
>> # I.e., "all" systems that have Python installed.
>Injecting a dependency on python being installed is a jaw-droppingly
>stupid way to deal with some command not working on MacOS.
Well, that was certainly my first reaction as well, but, FWIW, I think
Macs (i.e., OSX) do come with Python pre-installed.
For a person of Hongyi's obviously limited skills and scope of problem, it
seems reasonable to assume that if it works on his system (which it will),
then the problem is solved.
>You might as well just demand that the Mac user have GNU Coreutils,
>and then use realpath.
Or, even easier, write your own - given that, as I said earlier, it's just
a very thin wrapper around realpath(3). A few lines of C would do it.
FWIW, I wrote one in AWK, that I used for a long time until I figured out
that it was available as a bash builtin. Of course, this was my own,
customizer version of GAWK that has the ability to call system library
functions from GAWK source. Again, in the FWIW, I think you could do it in
stock Perl (I don't do Perl so can't say for sure), since I think Perl
gives direct access to system library functions (without the need for a
local hack to the source code).
--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/Pearls