Skip to content

Conversation

@katrinabrock
Copy link

Current wording of

If given three or more arguments, cp throws an error such as the one below,

is not accurate. The intended meaning seems to be "If cp is 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.

@github-actions
Copy link

🆗 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.

Comment on lines -729 to -730
When `cp` is given two arguments and the second is a destination directory
`cp` copies the files to the destination directory.
Copy link
Contributor

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.

Copy link
Author

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.

Comment on lines 729 to 733
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".
Copy link
Contributor

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?

Copy link
Author

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.

Comment on lines 734 to 736
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Author

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.

@katrinabrock katrinabrock requested a review from bkmgit November 3, 2025 14:49
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

Successfully merging this pull request may close these issues.

2 participants