-
Notifications
You must be signed in to change notification settings - Fork 19
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
Patch 1 #54
base: gh-pages
Are you sure you want to change the base?
Patch 1 #54
Conversation
FYI: I have a bigger PR coming on this (probably next week) |
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 am not sure why sed is being proposed instead of tr - what is the rationale? The sed command as written looks intimidating to a new user, whereas the tr command looks easily parseable. I won't merge this until I know why we would make this change.
Hello, sed is used because that tr command generates blank lines in case of repeated spaces, and normally it's not good; in a single command sed substitutes spaces and tabs, repeated and mixed a gives a clean ouput. Since basic regular expressions are covered on episode 02 and sed is used in this episode, I think that it's useful for people to see that example of sed usage. I don't think it's intimidating, no more than: |
OK, I suppose this makes sense. I can merge if other people agree. @drjwbaker ? |
Agreed. Looks a great change. |
The command looks intimidating, but agree that it's not worse than other stuff in this episode. It's also more realistic, and perhaps it's good to stress regexps rather than introducing yet another command ( Perhaps change "repeated space" to "repeated whitespace"? Also, is it necessary/correct to escape |
Hello, I'm changing "repeated space" to "repeated whitespace", thank you. |
changed "repeated space" into "repeated whitespace"
Ouch, Even if we use the Test:
Perhaps we need to stick with |
Hello, it's because of different sed versions, the one I've used in example is GNU sed, installed on |
Forgot to say: thank you for your analysis! |
I'm sorry, it's really annoying when you find a nice example command, just to learn that it doesn't work cross platform.. Anyways, Can confirm that this works:
(Had to include The last example also, not sure which one is the best to teach.. |
I forgot to set the "-E" flag, sorry. |
Hello, I think that 3 examples should be changed: after a "uniq -c" command a "-n" flag on sort command is very useful.
About sed command: I think that removing spaces or normalizing them is a very common need and the example using sed could be appreciated, in my opinion