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

Recursive option different between commands #996

Closed
lennertz opened this issue Jul 10, 2019 · 6 comments
Closed

Recursive option different between commands #996

lennertz opened this issue Jul 10, 2019 · 6 comments

Comments

@lennertz
Copy link

in Unix shell lesson there is some emphasis on -R meaning recursive. In all future lessons, as we move throughout different commands -r is (appropriately) uses for recursive eventhough -R is also acceptable. Maybe we need to be more consistent or at least add some info on how options do change based on the commands and to check the help.

@gcapes
Copy link
Contributor

gcapes commented Jul 28, 2019

Thanks for the issue.
The -R option is used with ls, at which point we have a discussion about options and how to discover them via man and --help. There isn't a suggestion that the options are the same for different commands, but perhaps that could be made explicit somewhere in episode 2.

@gcapes
Copy link
Contributor

gcapes commented Jul 28, 2019

Or perhaps this would be better mentioned in episode 3, on first use of cp -r. I think it might be information overload to introduce it in episode 2.

@gcapes gcapes changed the title Issue with explanation of Recursive Recursive option different between commands Jul 28, 2019
@gdevenyi
Copy link
Contributor

An unfortunate instance of commands being developed separately and converging to similar functionality, sometimes the interfaces differ.

@colinmorris
Copy link
Contributor

It looks like /-[rR]/ is used in the following commands:

  1. ls -R
  2. ls -r
  3. cp -r
  4. rm -r
  5. sort -r
  6. grep -r

In 2 and 5, it does not signify 'recursive'. In all cases, the flags are explained where they're used (semi-exception for grep, but the exercise in which the flag is used explicitly asks the reader to look at man grep).

I don't think this should be too confusing (given that the flags are explained), and I have a couple (minor) issues with changing all recursive flags to -R:

  • It could give the reader the false impression that flags will generally have consistent meanings across commands
  • Technically grep -r and grep -R have slightly different functionality (related to symlinks)
  • I get the impression that the lowercase -r flag is generally more commonly used with grep/rm/cp, so readers are more likely to encounter that form in the wild.

@gcapes
Copy link
Contributor

gcapes commented Dec 16, 2019

Any outstanding action required for this?

We could mention somewhere that options don't necessarily have the same meaning for different commands. However, I'm not sure that this is really needed. What do others think?

@gcapes
Copy link
Contributor

gcapes commented Oct 14, 2020

Closing stale issue

@gcapes gcapes closed this as completed Oct 14, 2020
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

4 participants