Skip to content

Commit f1e896c

Browse files
committed
incorporated changes from @ataustin
1 parent 2ef9725 commit f1e896c

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

04-Working-with-Unix.Rmd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ egrep "\s" small.txt
605605
```
606606

607607
As you can see in the example above, the `\w` metacharacter matches all letters,
608-
numbers, and even the underscore character (`_`). We can see the compliment of
608+
numbers, and even the underscore character (`_`). We can see the complement of
609609
this grep by adding the `-v` flag to the command:
610610

611611
```{r, engine='bash', eval=FALSE}
@@ -640,7 +640,7 @@ In addition to general character sets we can also create specific character
640640
sets using square brackets (`[ ]`) and then including the characters we wish to
641641
match in the square brackets. For example the regular expression for the set
642642
of vowels is `[aeiou]`. You can also create a regular expression for the
643-
compliment of a set by including a caret (`^`) in the beginning of a set. For
643+
complement of a set by including a caret (`^`) in the beginning of a set. For
644644
example the regular expression `[^aeiou]` matches all characters that are not
645645
vowels. Let's test both on small.txt:
646646

@@ -888,8 +888,8 @@ a table with several of the metacharacters we've discussed in this chapter:
888888
| ? | Zero or One of Previous |
889889
| | | Either the Previous or the Following |
890890
| {6} | Exactly 6 of Previous |
891-
| {4, 6} | Between 4 and 6 or Previous |
892-
| {4, } | More than 4 of Previous |
891+
| {4, 6} | Between 4 and 6 of Previous |
892+
| {4, } | 4 or more of Previous |
893893

894894
If you want to experiment with writing regular expressions before you use them
895895
I highly recommend playing around with http://regexr.com/.
@@ -1033,7 +1033,7 @@ alias edbp='nano ~/.bash_profile'
10331033

10341034
The first `alias` creates a new command `docs`. Now entering `docs` into the
10351035
command line is the equivalent of entering `cd ~/Documents` into the comamnd
1036-
line. Open let's edit our `~/.bash_profile` with `nano`. If there's anything
1036+
line. Let's edit our `~/.bash_profile` with `nano`. If there's anything
10371037
in your `~/.bash_profile` already then start adding lines at the end of the
10381038
file. Add the line `alias docs='cd ~/Documents'`, then save the file and quit
10391039
`nano`. In order to make the changes to our `~/.bash_profile` take effect we
@@ -1238,7 +1238,7 @@ British Columbia
12381238
Notice that this is the same result we would get from `head -n 5 canada.txt`,
12391239
we just used `cat` to illustrate how the pipe works. The general syntax of the
12401240
pipe is
1241-
`[program that produces output] | [program uses pipe output as input instead of a file]`.
1241+
`[program that produces output] | [program that uses pipe output as input instead of a file]`.
12421242

12431243
A more common and useful example where we could use the pipe is answering the
12441244
question: "How many US states end in a vowel?" We could use `grep` and regular
@@ -1256,7 +1256,7 @@ grep "[aeiou]$" states.txt | wc -l
12561256
The pipe can also be used multiple times in one command in order to take
12571257
the output from one piped command and use it as the input to yet another program!
12581258
For example we could use three pipes with `ls`, `grep`, and `less` so that we
1259-
could scroll through the files in out current directory were created in February:
1259+
could scroll through the files in our current directory that were created in February:
12601260

12611261
```{r, engine='bash', eval=FALSE}
12621262
ls -al | grep "Feb" | less
@@ -1313,7 +1313,7 @@ draft_journal_entry.txt:
13131313
touch draft_journal_entry.txt
13141314
```
13151315

1316-
The simple `makefile` above shows illustrates a **rule** which has the
1316+
The simple `makefile` above illustrates a **rule** which has the
13171317
following general format:
13181318

13191319
```
@@ -1508,7 +1508,7 @@ clean:
15081508
rm readme.txt
15091509
```
15101510

1511-
Let's save and close our `makefile` then let's test it out first let's clean up
1511+
Let's save and close our `makefile` then let's test it out. First let's clean up
15121512
our repository:
15131513

15141514
```{r, engine='bash', eval=FALSE}

05-Bash-Programming.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ bash simpleelif.sh 5
825825
## 5 is a great number
826826
```
827827

828-
If first condition is false since 5 is not equal to 4, but then the next
828+
The first condition is false since 5 is not equal to 4, but then the next
829829
condition in the ELIF statement is true since 5 is greater than 3, so that
830830
echo command is executed and the rest of the statement is skipped. Try to guess
831831
what will happen if we use `2` as an argument:
@@ -934,7 +934,7 @@ expressions, and IF statements allow you to write more powerful Bash programs.
934934
- Conditional execution uses two operators: AND (`&&`) and OR (`||`) which you
935935
can use to control what command get executed based on their exit status.
936936
- Conditional expressions are always in double brackets (`[[ ]]`). They have
937-
exit an exit status of 0 if they contain a true assertion or 1 if they contain
937+
an exit status of 0 if they contain a true assertion or 1 if they contain
938938
a false assertion.
939939
- IF statements evaluate conditional expressions. If an expression is true then
940940
the code within an IF statement is executed, otherwise it is skipped.
@@ -1345,7 +1345,7 @@ done
13451345
```
13461346

13471347
If the program is working, then `count` is being incremented very rapidly and
1348-
you're watching number wiz by in your terminal! Don't fret, you can terminate
1348+
you're watching numbers whiz by in your terminal! Don't fret, you can terminate
13491349
any program that's stuck in an infinite loop using `Control` + `C`. Use
13501350
`Control` + `C` to get the prompt back so that we can continue.
13511351

06-Git-and-GitHub.Rmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,8 @@ git commit -m "added weather info"
844844

845845
This is a small example of how to use Git branching, but you can see how you
846846
can make incremental edits to plain text (usually code files) without
847-
effecting the `master` branch (the tested and working copy of your software)
848-
and without effecting any other branches. You can imagine how
847+
affecting the `master` branch (the tested and working copy of your software)
848+
and without affecting any other branches. You can imagine how
849849
this system could be used for multiple people to work on the same codebase at
850850
the same time, or how you could develop and test multiple software features
851851
without them interfering with each other. Now that we've made a couple of
@@ -1227,7 +1227,7 @@ wrote has been rendered according to a few rules:
12271227
- Pound signs (`#`, `##`) make headings.
12281228
- A word surrounded by single asterisks (`*word*`) makes that word *italicized*.
12291229
- A word surrounded by double asterisks (`**word**`) makes that word **bold**.
1230-
- You can create lists with hyphens (`-`) or numbers (`1., 2., 3.`).
1230+
- You can create lists with hyphens (`-`) or numbers (`1.`, `2.`, `3.`).
12311231
- Code can be placed in the middle of a line with single backticks (`` `code` ``).
12321232
- A code block can be created by putting code in between a set of triple
12331233
backticks (`` ``` ``).
@@ -1645,7 +1645,7 @@ be merged into the upstream repository!
16451645
1. Create a new repository on GitHub. Clone your repository and add a
16461646
`README.md` file. Push this file to GitHub and create a GitHub Pages website
16471647
for this repository.
1648-
2. Fork an existing repository (try one of mine https://github.com/seankross)
1648+
2. Fork an existing repository (try one of mine: https://github.com/seankross)
16491649
and try to identify something valuable you could contribute. Make changes or
16501650
additions to that repository, then open a pull request.
16511651
3. Read through [GitHub's Guides](https://guides.github.com/).

0 commit comments

Comments
 (0)