-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Clarify cp behavior
#1513
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
base: main
Are you sure you want to change the base?
Clarify cp behavior
#1513
Conversation
🆗 Pre-flight checks passed 😃This pull request has been checked and contains no modified workflow files, spoofing, or invalid commits. It should be safe to Approve and Run the workflows that need maintainer approval. |
| When `cp` is given two arguments and the second is a destination directory | ||
| `cp` copies the files to the destination directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is helpful to distinguish between two and three arguments because for two arguments, if the second argument is not a directory but a filename, then the first file is copied and renamed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Current text does not do this, but I agree it would be good to add. Maybe even in the main text rather than nested inside a challenge and solution.
episodes/03-create.md
Outdated
| When `cp` is given three or more arguments, | ||
| the last argument is interpretted as the "destination | ||
| directory". | ||
| In that case, `cp` copies all files (or directories) | ||
| into that "destination directory". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above is nicely explained. Can it be made shorter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll give it a try.
episodes/03-create.md
Outdated
| If the final argument is not a directory, | ||
| it's unclear what should be copied where so | ||
| `cp` throws an error such as the one below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| If the final argument is not a directory, | |
| it's unclear what should be copied where so | |
| `cp` throws an error such as the one below. | |
| If the final argument is not a directory, | |
| the behavior is undefined, so | |
| `cp` throws an error such as the one below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "undefined behavior" might be a phrase that learners are unfamiliar with. I'll try to think of a way to say the same thing in simpler words.
Current wording of
is not accurate. The intended meaning seems to be "If
cpis given more than three filenames as arguments, it throws an error such as the one below."Tried my best to reword in a way that is clear, concise, and accurate.