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

Made changes and added General Syntax episode. #992

Open
wants to merge 2 commits into
base: gh-pages
from

Conversation

Projects
None yet
3 participants
@jackVanish
Copy link

commented Jun 28, 2019

Pursuant to discussion here (#963), I've broken out the 'General Syntax' of a shell command to its own episode. This gives a stronger foundation to later lessons and cover basic concepts, including default flags and man pages, before they're introduced.

I've left the estimated time spots blank since I wasn't sure how best to estimate those. Also the lesson has few exercises, and I'm not sure if someone else better-equipped would want to build those in. Hopefully the syntax is all in order, though. I haven't changed much of the wording, but I did rewrite the questions and learning goals, as well as added the section on default flags.

@jackVanish jackVanish referenced this pull request Jun 28, 2019

Open

wc clarity #963

@gcapes
Copy link
Contributor

left a comment

Thanks for your PR! It's nice to be able to visualise a suggestion.
I think it's a nice idea to split out the general syntax of a command into its own section. I'll spend a bit more time on this when I can, but have a few initial thoughts I've put in comments.

> A good example of this is the 'wc' command, which has the default flags -c, -l,
> and -w. This means that running 'wc' is equivalent to running 'wc -clw'. If a
> command has default flags, they will be listed in the manual, or 'man' page, usually under
> the 'Description' section. We will cover man pages and how to read them in the

This comment has been minimized.

Copy link
@gcapes

gcapes Jul 1, 2019

Contributor

Default options for wc are not listed anywhere in my man pages or --help output on Linux Mint. Which OS are you using?

This comment has been minimized.

Copy link
@jackVanish

jackVanish Jul 2, 2019

Author

I'm using Mac OSX. The part I'm referring to is at the bottom of the Description section (see attached screenshot) that reads 'The default action is equivalent to specifying the -c, -l and -w options."

Screen Shot 2019-07-02 at 9 08 18 AM

This comment has been minimized.

Copy link
@gcapes

gcapes Jul 2, 2019

Contributor

Ah, I see. This isn't given in my man pages on Linux. We should be trying to avoid material where the output is very different depending on platform. I don't know what the man pages look like on Git Bash.

SYNOPSIS
       wc [OPTION]... [FILE]...
       wc [OPTION]... --files0-from=F

DESCRIPTION
       Print  newline,  word,  and byte counts for each FILE, and a total line if more than one FILE is specified.  A
       word is a non-zero-length sequence of characters delimited by white space.

       With no FILE, or when FILE is -, read standard input.

       The options below may be used to select which counts are printed, always  in  the  following  order:  newline,
       word, character, byte, maximum line length.

       -c, --bytes
              print the byte counts

       -m, --chars
              print the character counts

       -l, --lines
              print the newline counts

       --files0-from=F
              read  input  from the files specified by NUL-terminated names in file F; If F is - then read names from
              standard input

       -L, --max-line-length
              print the maximum display width

       -w, --words
              print the word counts

       --help display this help and exit

       --version
              output version information and exit

AUTHOR
       Written by Paul Rubin and David MacKenzie.

REPORTING BUGS
       GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
       Report wc translation bugs to <http://translationproject.org/team/>

COPYRIGHT
       Copyright  ©  2016  Free  Software  Foundation,  Inc.   License  GPLv3+:  GNU   GPL   version   3   or   later
       <http://gnu.org/licenses/gpl.html>.

This comment has been minimized.

Copy link
@gdevenyi

gdevenyi Jul 2, 2019

Contributor

Implicit on the manpage, but its there:

Print newline, word, and byte counts for each FILE

> ## Default Flags
>
> Some commands, when run without any flags, will assume one or more by default.
> A good example of this is the 'wc' command, which has the default flags -c, -l,

This comment has been minimized.

Copy link
@gcapes

gcapes Jul 1, 2019

Contributor

Backticks for wc please.

Some questions learners might have at this point on seeing this new command:

  • What is the wordcount command?
  • What does it do?
  • Can I run an example of it?

This comment has been minimized.

Copy link
@jackVanish

jackVanish Jul 2, 2019

Author

Thinking this over, to really test wc you'd need to make a file or have one handy to run wc on. Making files seems like a lot for this early lesson- what do you think a good way to deal with this would be?

This comment has been minimized.

Copy link
@gcapes

gcapes Jul 2, 2019

Contributor

I would drop this section. Not sure what others think?

This comment has been minimized.

Copy link
@jackVanish

jackVanish Jul 2, 2019

Author

The impetus for creating the PR was better clarity around WC and its default flags but I'm not married to it being there. It doesn't seem like there's a good place to fit it in.

This comment has been minimized.

Copy link
@jackVanish

jackVanish Jul 2, 2019

Author

I've taken it out, which should address both of the two comments above.

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.