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

Ep3 - Copy with Multiple Filenames Example Clarification Needed #919

Open
Sarahbssn opened this issue Feb 12, 2019 · 5 comments

Comments

Projects
None yet
4 participants
@Sarahbssn
Copy link

commented Feb 12, 2019

In the "Working With Files and Directories" episode (3), the example "Copy with Multiple Filenames" needs some clarification regarding the second part in that execution of:
$ cp amino-acids.txt animals.txt morse.txt

Does not always result in:
cp: target ‘morse.txt’ is not a directory

On my system (Mac), the error is not produced and instead I receive the output (double checked my working directory too):
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory

I am fairly inexperienced with terminal, but others completing this lesson may also have the same problem. From what I can tell based on my experimentation of "cp", it may work differently than when then episode was created/last updated. Either way, it was strange to me as a novice user.

Anyone else seeing this result on their system? It might be a simple modification of stating that the command will not work as expected or produce an error.

@gcapes

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2019

Thanks for the issue!

My Bash shell on Linux Mint gives the error message shown in the lesson. Your shell is telling you the same thing, but has phrased it a bit less explicitly. So the issue is that the error message given depends on your OS/Shell version.

@swcarpentry/shell-maintainers
We have discussed previously about trying to avoid littering the lesson with exceptions. Perhaps a light-touch here would be to edit the wording to

If given more than one file name followed by a directory name (i.e. the destination directory must be the last argument), cp copies the files to the named directory.

If given three file names, cp throws an error such as the one below because it is expecting a directory name as the last argument.

@gdevenyi

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2019

+1 for the adjustment.

Reason for difference is gnu coreutils in Linux vs bad terminal tools in osx

@gdevenyi

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2019

***bsd

gcapes added a commit to gcapes/shell-novice that referenced this issue Feb 13, 2019

Acknowledge that error message might differ from lesson
If learner has a different implementation of Bash e.g. BSD,
the error message won't always be the same.

Fix swcarpentry#919.

@gcapes gcapes referenced a pull request that will close this issue Feb 13, 2019

Open

Acknowledge that error message might differ from lesson #920

@gcapes

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2019

LOL, love the typo :)

@Sarahbssn

This comment has been minimized.

Copy link
Author

commented Feb 13, 2019

Thanks for all the feedback and commit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.