@@ -605,7 +605,7 @@ egrep "\s" small.txt
605
605
```
606
606
607
607
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
609
609
this grep by adding the ` -v ` flag to the command:
610
610
611
611
``` {r, engine='bash', eval=FALSE}
@@ -640,7 +640,7 @@ In addition to general character sets we can also create specific character
640
640
sets using square brackets (` [ ] ` ) and then including the characters we wish to
641
641
match in the square brackets. For example the regular expression for the set
642
642
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
644
644
example the regular expression ` [^aeiou] ` matches all characters that are not
645
645
vowels. Let's test both on small.txt:
646
646
@@ -888,8 +888,8 @@ a table with several of the metacharacters we've discussed in this chapter:
888
888
| ? | Zero or One of Previous |
889
889
| | ; | Either the Previous or the Following |
890
890
| {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 |
893
893
894
894
If you want to experiment with writing regular expressions before you use them
895
895
I highly recommend playing around with http://regexr.com/ .
@@ -1033,7 +1033,7 @@ alias edbp='nano ~/.bash_profile'
1033
1033
1034
1034
The first ` alias ` creates a new command ` docs ` . Now entering ` docs ` into the
1035
1035
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
1037
1037
in your ` ~/.bash_profile ` already then start adding lines at the end of the
1038
1038
file. Add the line ` alias docs='cd ~/Documents' ` , then save the file and quit
1039
1039
` nano ` . In order to make the changes to our ` ~/.bash_profile ` take effect we
@@ -1238,7 +1238,7 @@ British Columbia
1238
1238
Notice that this is the same result we would get from ` head -n 5 canada.txt ` ,
1239
1239
we just used ` cat ` to illustrate how the pipe works. The general syntax of the
1240
1240
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] ` .
1242
1242
1243
1243
A more common and useful example where we could use the pipe is answering the
1244
1244
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
1256
1256
The pipe can also be used multiple times in one command in order to take
1257
1257
the output from one piped command and use it as the input to yet another program!
1258
1258
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:
1260
1260
1261
1261
``` {r, engine='bash', eval=FALSE}
1262
1262
ls -al | grep "Feb" | less
@@ -1313,7 +1313,7 @@ draft_journal_entry.txt:
1313
1313
touch draft_journal_entry.txt
1314
1314
```
1315
1315
1316
- The simple ` makefile ` above shows illustrates a ** rule** which has the
1316
+ The simple ` makefile ` above illustrates a ** rule** which has the
1317
1317
following general format:
1318
1318
1319
1319
```
@@ -1508,7 +1508,7 @@ clean:
1508
1508
rm readme.txt
1509
1509
```
1510
1510
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
1512
1512
our repository:
1513
1513
1514
1514
``` {r, engine='bash', eval=FALSE}
0 commit comments