Re: `cp -l` doesn't work correctly on some macOS versions

Paul Eggert <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Organization UCLA Computer Science Department
Message-ID <[email protected]>
On 2/2/24 12:20, Russ Allbery wrote:
> I thought ln <target> <link> || ln -s <target> <link> was the standard
> recipe here

Yes, "cp -l" isn't required by POSIX and is not portable in general. For 
example, on AIX 7.1:

   $ cp -l a b
   cp: Not a recognized flag: l
   Usage: cp [-fhipHILPU][-d|-e] [-r|-R] [-E{force|ignore|warn}] [--] 
src target
      or: cp [-fhipHILPU] [-d|-e] [-r|-R] [-E{force|ignore|warn}] [--] 
src1 ... srcN directory

Autoconf provides AC_PROG_LN_S, which is supposed to be even more 
portable than the recipe you gave.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.