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

discouraging use of option -r with cp(1) #31

Closed
grahamperrin opened this issue Jun 17, 2017 · 4 comments
Closed

discouraging use of option -r with cp(1) #31

grahamperrin opened this issue Jun 17, 2017 · 4 comments

Comments

@grahamperrin
Copy link

From Apple's legacy cp(1) Mac OS X Manual Page:

COMPATIBILITY

Historic versions of the cp utility had a -r option. This implementation supports that option; however, its use is strongly discouraged, as it does not correctly copy special files, symbolic links, or fifo's.

The -v and -n options are non-standard and their use in scripts is not recommended.

– (sic; should be fifos (not fifo's)). The same discouragement appears in the manual page for cp(1) in pre-release build 17A264c of Mac OS X 10.13.

Please:

  • does anyone know of a good reason for the use of -r in prepare-iso.sh?

(I sped through some of the documentation that's referred from README.md, found no explanation.)

@robbintt
Copy link

I have always been interested in this so I looked for an answer. Here is what I found.

https://unix.stackexchange.com/questions/18712/difference-between-cp-r-and-cp-r-copy-command

It appears that it all comes down to posix and those should be changed to "-R".

Best,
Trent

@geerlingguy
Copy link
Owner

Yeah, -r was probably just fat-fingered on my part. I think they should be -R.

@grahamperrin
Copy link
Author

grahamperrin commented Jun 22, 2017

Thank you both.

@robbintt yeah, I glanced at the same page before posting here.

@geerlingguy you're not fat-fingered :-) the -r precedent is at the pages linked from:

– and probably elsewhere.

Re: #28 (comment) alternatively there's ditto(8).

@geerlingguy
Copy link
Owner

The -r option isn't even mentioned in the official cp man pages anymore. Will commit a fix in a few.

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

3 participants