would you be safe in using --recursive always? (e.g. shell scripts)

Double dash long options are basically a GNU extension. BSD utilities generally don't support them. Apparently macOS does not either (since it's based off of FreeBSD)

macOS was based off NeXTSTEP, not FreeBSD.

And the received wisdom about long options in the BSDs is a quarter of a century out of date. When the BSDs gained a getopt_long() in their C libraries thanks to Klausner and Baron, long options quietly started appearing. This process has been gradually and quietly on-going for the whole of the 21st century.

Much of the macos Unix userland is from FreeBSD as are some parts of the kernel, such as the ip stack. Check the man pages for cp and friends in mac and I believe they still reference FreeBSD.

> And the received wisdom about long options in the BSDs is a quarter of a century out of date.

Incidentally, so is much of the FreeBSD code. Many things were taken once, never updated from upstream again. I think a lot of the userland did get an update somewhere around 2014... all of a sudden, cal would highlight the current date, years after that happened upstream. But the IP stack hasn't gotten any updates from upstream AFAIK, probably because Apple customized it and it's too much work to merge in improvements that probably won't be noticed on client systems (things like syncookies).

> macOS was based off NextBSD, not FreeBSD.

"NextBSD" was first released in 2015:

* https://en.wikipedia.org/wiki/NextBSD

Over a decade after macOS/Mac OS X was initially released:

> macOS (previously OS X and originally Mac OS X) is a proprietary Unix[7][8] operating system, derived from OPENSTEP for Mach and FreeBSD, which has been marketed and developed by Apple since 2001.

* https://en.wikipedia.org/wiki/MacOS

> Darwin is the core Unix-like operating system of macOS, iOS, watchOS, tvOS, iPadOS, audioOS, visionOS, and bridgeOS. It previously existed as an independent open-source operating system, first released by Apple in 2000. It is composed of code derived from NeXTSTEP, FreeBSD[3] and other BSD operating systems,[7] Mach, and […]

* https://en.wikipedia.org/wiki/Darwin_(operating_system)

I remember reading release notes for FreeBSD in the '00s and seeing the exact same lines in the release notes for earlier versions of OS X.

> Darwin is the core Unix-like operating system of macOS

macOS isn't "Unix-like"; it's an Open Group certified UNIX™ [1].

[1]: https://www.opengroup.org/openbrand/register/brand3725.htm

Bah! Thought NeXTSTEP. Typed NextBSD. Fixed. I've been typing lots of names ending in 'BSD' today. (-:

I posted my original comment based off my pre-existing knowledge, but here's a more in-depth explanation of the macOS and FreeBSD situation (which aligns with my understanding):

https://www.reddit.com/r/freebsd/comments/1g07sdm/comment/lr...

Essentially, macOS was indeed based on NeXTSTEP originally, but over the years they copied quite a bit of BSD code over (mostly FreeBSD I think). I don't think the Unixy parts of the original NeXTSTEP survives much in modern macOS.

There are implementations of cp out in the wild that do not recognise the --recursive flag. OpenBSD was mentioned in the article and there’s also busybox cp https://busybox.net/downloads/BusyBox.html

I believe that -R is the safe works-as-expected-everywhere option.