Loops
-Last updated on 2023-05-16 | +
Last updated on 2023-07-23 | Edit this page
@@ -962,16 +962,17 @@BASH
Since she’s still learning how to use the shell, she decides to build up the required commands in stages. Her first step is to make sure that she can select the right input files — remember, these are ones whose -names end in ‘A’ or ‘B’, rather than ‘Z’. Starting from her home -directory, Nelle types:
+names end in ‘A’ or ‘B’, rather than ‘Z’. Moving to the +north-pacific-gyre
directory, Nelle types:
BASH
-$ cd north-pacific-gyre
-$ for datafile in NENE*A.txt NENE*B.txt
-> do
-> echo $datafile
-> done
+$ cd
+$ cd Desktop/shell-lesson-data/north-pacific-gyre
+$ for datafile in NENE*A.txt NENE*B.txt
+> do
+> echo $datafile
+> done
OUTPUT
@@ -1327,7 +1328,7 @@ Keypoints
Show me the solution
-
+
The correct answer is 3, because the -w
option looks
only for whole-word matches. The other options will also match ‘of’ when
@@ -645,7 +645,7 @@
Show me the solution
-
+
grep -w $1 -r $2 | cut -d : -f 2 | cut -d , -f 1,3 > $1.txt
Actually, you can swap the order of the two cut commands and it still
@@ -695,7 +695,7 @@
Solutions
-
+
for sis in Jo Meg Beth Amy
do
@@ -965,7 +965,7 @@
Show me the solution
-
+
Option 1. is correct. Putting the match expression in quotes prevents
the shell expanding it, so it gets passed to the find
@@ -1044,7 +1044,7 @@
Show me the solution
-
+
- Find all files with a
.dat
extension recursively from
the current directory
diff --git a/aio.html b/aio.html
index b59ded5bf..e4e883836 100644
--- a/aio.html
+++ b/aio.html
@@ -903,7 +903,7 @@
Show me the solution
-
+
The -l
option makes ls
use a
long listing format, showing not only the
@@ -941,7 +941,7 @@
Show me the solution
-
+
The most recently changed file is listed last when using
-rt
. This can be very useful for finding your most recent
@@ -1294,7 +1294,7 @@
Show me the solution
-
+
- No:
.
stands for the current directory.
@@ -1342,7 +1342,7 @@
Show me the solution
-
+
- No: there is a directory
backup
in
@@ -1390,7 +1390,7 @@
Show me the solution
-
+
- No:
pwd
is not the name of a directory.
@@ -3807,7 +3807,7 @@ KeypointsContent from Loops
- Last updated on 2023-05-16 |
+
Last updated on 2023-07-23 |
Edit this page
@@ -4521,16 +4521,17 @@ BASHSince she’s still learning how to use the shell, she decides to build
up the required commands in stages. Her first step is to make sure that
she can select the right input files — remember, these are ones whose
-names end in ‘A’ or ‘B’, rather than ‘Z’. Starting from her home
-directory, Nelle types:
+names end in ‘A’ or ‘B’, rather than ‘Z’. Moving to the
+north-pacific-gyre
directory, Nelle types:
BASH
-$ cd north-pacific-gyre
-$ for datafile in NENE*A.txt NENE*B.txt
-> do
-> echo $datafile
-> done
+$ cd
+$ cd Desktop/shell-lesson-data/north-pacific-gyre
+$ for datafile in NENE*A.txt NENE*B.txt
+> do
+> echo $datafile
+> done
OUTPUT
@@ -5894,7 +5895,7 @@
Show me the solution
-
+
The correct answer is 3, because the -w
option looks
only for whole-word matches. The other options will also match ‘of’ when
@@ -5996,7 +5997,7 @@
Show me the solution
-
+
grep -w $1 -r $2 | cut -d : -f 2 | cut -d , -f 1,3 > $1.txt
Actually, you can swap the order of the two cut commands and it still
@@ -6046,7 +6047,7 @@
Solutions
-
+
for sis in Jo Meg Beth Amy
do
@@ -6318,7 +6319,7 @@
Show me the solution
-
+
Option 1. is correct. Putting the match expression in quotes prevents
the shell expanding it, so it gets passed to the find
@@ -6397,7 +6398,7 @@
Show me the solution
-
+
- Find all files with a
.dat
extension recursively from
diff --git a/instructor/02-filedir.html b/instructor/02-filedir.html
index ff810df6c..a2dd145b2 100644
--- a/instructor/02-filedir.html
+++ b/instructor/02-filedir.html
@@ -312,7 +312,7 @@
Instructor Note
-
+
Introducing and navigating the filesystem in the shell (covered in Navigating Files and Directories section) can
be confusing. You may have both terminal and GUI file explorer open side
@@ -642,7 +642,7 @@
Show me the solution
-
+
The -l
option makes ls
use a
long listing format, showing not only the
@@ -680,7 +680,7 @@
Show me the solution
-
+
The most recently changed file is listed last when using
-rt
. This can be very useful for finding your most recent
@@ -1029,7 +1029,7 @@
Show me the solution
-
+
- No:
.
stands for the current directory.
- No:
/
stands for the root directory.
@@ -1072,7 +1072,7 @@
Show me the solution
-
+
- No: there is a directory
backup
in
/Users
.
@@ -1116,7 +1116,7 @@
Show me the solution
-
+
- No:
pwd
is not the name of a directory.
- Yes:
ls
without directory argument lists files and
diff --git a/instructor/05-loop.html b/instructor/05-loop.html
index 28df16b02..1c5c2f4af 100644
--- a/instructor/05-loop.html
+++ b/instructor/05-loop.html
@@ -258,7 +258,7 @@
Loops
- Last updated on 2023-05-16 |
+
Last updated on 2023-07-23 |
Edit this page
@@ -963,16 +963,17 @@ BASH
Since she’s still learning how to use the shell, she decides to build
up the required commands in stages. Her first step is to make sure that
she can select the right input files — remember, these are ones whose
-names end in ‘A’ or ‘B’, rather than ‘Z’. Starting from her home
-directory, Nelle types:
+names end in ‘A’ or ‘B’, rather than ‘Z’. Moving to the
+north-pacific-gyre
directory, Nelle types:
BASH
-$ cd north-pacific-gyre
-$ for datafile in NENE*A.txt NENE*B.txt
-> do
-> echo $datafile
-> done
+$ cd
+$ cd Desktop/shell-lesson-data/north-pacific-gyre
+$ for datafile in NENE*A.txt NENE*B.txt
+> do
+> echo $datafile
+> done
OUTPUT
@@ -1328,7 +1329,7 @@ Keypoints
Show me the solution
-
+
The correct answer is 3, because the -w
option looks
only for whole-word matches. The other options will also match ‘of’ when
@@ -646,7 +646,7 @@
Show me the solution
-
+
grep -w $1 -r $2 | cut -d : -f 2 | cut -d , -f 1,3 > $1.txt
Actually, you can swap the order of the two cut commands and it still
@@ -696,7 +696,7 @@
Solutions
-
+
for sis in Jo Meg Beth Amy
do
@@ -966,7 +966,7 @@
Show me the solution
-
+
Option 1. is correct. Putting the match expression in quotes prevents
the shell expanding it, so it gets passed to the find
@@ -1045,7 +1045,7 @@
Show me the solution
-
+
- Find all files with a
.dat
extension recursively from
the current directory
diff --git a/instructor/aio.html b/instructor/aio.html
index dcf58231a..2407c4071 100644
--- a/instructor/aio.html
+++ b/instructor/aio.html
@@ -580,7 +580,7 @@
Instructor Note
-
+
Introducing and navigating the filesystem in the shell (covered in Navigating Files and Directories section) can
be confusing. You may have both terminal and GUI file explorer open side
@@ -919,7 +919,7 @@
Show me the solution
-
+
The -l
option makes ls
use a
long listing format, showing not only the
@@ -957,7 +957,7 @@
Show me the solution
-
+
The most recently changed file is listed last when using
-rt
. This can be very useful for finding your most recent
@@ -1310,7 +1310,7 @@
Show me the solution
-
+
- No:
.
stands for the current directory.
@@ -1358,7 +1358,7 @@
Show me the solution
-
+
- No: there is a directory
backup
in
@@ -1406,7 +1406,7 @@
Show me the solution
-
+
- No:
pwd
is not the name of a directory.
@@ -3844,7 +3844,7 @@ KeypointsContent from Loops
- Last updated on 2023-05-16 |
+
Last updated on 2023-07-23 |
Edit this page
Estimated time 50 minutes
@@ -4559,16 +4559,17 @@ BASHSince she’s still learning how to use the shell, she decides to build
up the required commands in stages. Her first step is to make sure that
she can select the right input files — remember, these are ones whose
-names end in ‘A’ or ‘B’, rather than ‘Z’. Starting from her home
-directory, Nelle types:
+names end in ‘A’ or ‘B’, rather than ‘Z’. Moving to the
+north-pacific-gyre
directory, Nelle types:
BASH
-$ cd north-pacific-gyre
-$ for datafile in NENE*A.txt NENE*B.txt
-> do
-> echo $datafile
-> done
+$ cd
+$ cd Desktop/shell-lesson-data/north-pacific-gyre
+$ for datafile in NENE*A.txt NENE*B.txt
+> do
+> echo $datafile
+> done
OUTPUT
@@ -5934,7 +5935,7 @@
Show me the solution
-
+
The correct answer is 3, because the -w
option looks
only for whole-word matches. The other options will also match ‘of’ when
@@ -6036,7 +6037,7 @@
Show me the solution
-
+
grep -w $1 -r $2 | cut -d : -f 2 | cut -d , -f 1,3 > $1.txt
Actually, you can swap the order of the two cut commands and it still
@@ -6086,7 +6087,7 @@
Solutions
-
+
for sis in Jo Meg Beth Amy
do
@@ -6358,7 +6359,7 @@
Show me the solution
-
+
Option 1. is correct. Putting the match expression in quotes prevents
the shell expanding it, so it gets passed to the find
@@ -6437,7 +6438,7 @@
Show me the solution
-
+
- Find all files with a
.dat
extension recursively from
diff --git a/md5sum.txt b/md5sum.txt
index 4f1ceaab7..51bf6fa3c 100644
--- a/md5sum.txt
+++ b/md5sum.txt
@@ -7,7 +7,7 @@
"episodes/02-filedir.md" "84f64bc9d0c8868f573383d5ccfa99d1" "site/built/02-filedir.md" "2023-06-18"
"episodes/03-create.md" "f8cff1c78a401684b728ebea3c36cbec" "site/built/03-create.md" "2023-06-18"
"episodes/04-pipefilter.md" "8f1f5df56fb9ed60db6f33a9793664d5" "site/built/04-pipefilter.md" "2023-07-19"
-"episodes/05-loop.md" "9858630db913016e302d18d2ee2dbfa3" "site/built/05-loop.md" "2023-05-16"
+"episodes/05-loop.md" "aba486ff4e9c3dec7a7d5e121792151a" "site/built/05-loop.md" "2023-07-23"
"episodes/06-script.md" "e214b3c6c95e4b43c7ed6aa7b5a2809a" "site/built/06-script.md" "2023-06-05"
"episodes/07-find.md" "ee2c6b006da9c8a66a850f2e6a720a5d" "site/built/07-find.md" "2023-05-02"
"instructors/instructor-notes.md" "5db2f86826be7c6bba6157eb15a8a881" "site/built/instructor-notes.md" "2023-06-18"
diff --git a/pkgdown.yml b/pkgdown.yml
index 7b6d805a0..2fd5efcfb 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -2,5 +2,5 @@ pandoc: 2.19.2
pkgdown: 2.0.7
pkgdown_sha: ~
articles: {}
-last_built: 2023-07-23T05:44Z
+last_built: 2023-07-23T08:40Z
The correct answer is 3, because the -w
option looks
only for whole-word matches. The other options will also match ‘of’ when
@@ -645,7 +645,7 @@
Show me the solution
-grep -w $1 -r $2 | cut -d : -f 2 | cut -d , -f 1,3 > $1.txt
Actually, you can swap the order of the two cut commands and it still @@ -695,7 +695,7 @@
Solutions
-for sis in Jo Meg Beth Amy
do
@@ -965,7 +965,7 @@
Show me the solution
-
+
Option 1. is correct. Putting the match expression in quotes prevents
the shell expanding it, so it gets passed to the find
@@ -1044,7 +1044,7 @@
Show me the solution
-
+
- Find all files with a
.dat
extension recursively from
the current directory
diff --git a/aio.html b/aio.html
index b59ded5bf..e4e883836 100644
--- a/aio.html
+++ b/aio.html
@@ -903,7 +903,7 @@
Show me the solution
-
+
The -l
option makes ls
use a
long listing format, showing not only the
@@ -941,7 +941,7 @@
Show me the solution
-
+
The most recently changed file is listed last when using
-rt
. This can be very useful for finding your most recent
@@ -1294,7 +1294,7 @@
Show me the solution
-
+
- No:
.
stands for the current directory.
@@ -1342,7 +1342,7 @@
Show me the solution
-
+
- No: there is a directory
backup
in
@@ -1390,7 +1390,7 @@
Show me the solution
-
+
- No:
pwd
is not the name of a directory.
@@ -3807,7 +3807,7 @@ KeypointsContent from Loops
- Last updated on 2023-05-16 |
+
Last updated on 2023-07-23 |
Edit this page
@@ -4521,16 +4521,17 @@ BASHSince she’s still learning how to use the shell, she decides to build
up the required commands in stages. Her first step is to make sure that
she can select the right input files — remember, these are ones whose
-names end in ‘A’ or ‘B’, rather than ‘Z’. Starting from her home
-directory, Nelle types:
+names end in ‘A’ or ‘B’, rather than ‘Z’. Moving to the
+north-pacific-gyre
directory, Nelle types:
BASH
-$ cd north-pacific-gyre
-$ for datafile in NENE*A.txt NENE*B.txt
-> do
-> echo $datafile
-> done
+$ cd
+$ cd Desktop/shell-lesson-data/north-pacific-gyre
+$ for datafile in NENE*A.txt NENE*B.txt
+> do
+> echo $datafile
+> done
OUTPUT
@@ -5894,7 +5895,7 @@
Show me the solution
-
+
The correct answer is 3, because the -w
option looks
only for whole-word matches. The other options will also match ‘of’ when
@@ -5996,7 +5997,7 @@
Show me the solution
-
+
grep -w $1 -r $2 | cut -d : -f 2 | cut -d , -f 1,3 > $1.txt
Actually, you can swap the order of the two cut commands and it still
@@ -6046,7 +6047,7 @@
Solutions
-
+
for sis in Jo Meg Beth Amy
do
@@ -6318,7 +6319,7 @@
Show me the solution
-
+
Option 1. is correct. Putting the match expression in quotes prevents
the shell expanding it, so it gets passed to the find
@@ -6397,7 +6398,7 @@
Show me the solution
-
+
- Find all files with a
.dat
extension recursively from
diff --git a/instructor/02-filedir.html b/instructor/02-filedir.html
index ff810df6c..a2dd145b2 100644
--- a/instructor/02-filedir.html
+++ b/instructor/02-filedir.html
@@ -312,7 +312,7 @@
Instructor Note
-
+
Introducing and navigating the filesystem in the shell (covered in Navigating Files and Directories section) can
be confusing. You may have both terminal and GUI file explorer open side
@@ -642,7 +642,7 @@
Show me the solution
-
+
The -l
option makes ls
use a
long listing format, showing not only the
@@ -680,7 +680,7 @@
Show me the solution
-
+
The most recently changed file is listed last when using
-rt
. This can be very useful for finding your most recent
@@ -1029,7 +1029,7 @@
Show me the solution
-
+
- No:
.
stands for the current directory.
- No:
/
stands for the root directory.
@@ -1072,7 +1072,7 @@
Show me the solution
-
+
- No: there is a directory
backup
in
/Users
.
@@ -1116,7 +1116,7 @@
Show me the solution
-
+
- No:
pwd
is not the name of a directory.
- Yes:
ls
without directory argument lists files and
diff --git a/instructor/05-loop.html b/instructor/05-loop.html
index 28df16b02..1c5c2f4af 100644
--- a/instructor/05-loop.html
+++ b/instructor/05-loop.html
@@ -258,7 +258,7 @@
Loops
- Last updated on 2023-05-16 |
+
Last updated on 2023-07-23 |
Edit this page
@@ -963,16 +963,17 @@ BASH
Since she’s still learning how to use the shell, she decides to build
up the required commands in stages. Her first step is to make sure that
she can select the right input files — remember, these are ones whose
-names end in ‘A’ or ‘B’, rather than ‘Z’. Starting from her home
-directory, Nelle types:
+names end in ‘A’ or ‘B’, rather than ‘Z’. Moving to the
+north-pacific-gyre
directory, Nelle types:
BASH
-$ cd north-pacific-gyre
-$ for datafile in NENE*A.txt NENE*B.txt
-> do
-> echo $datafile
-> done
+$ cd
+$ cd Desktop/shell-lesson-data/north-pacific-gyre
+$ for datafile in NENE*A.txt NENE*B.txt
+> do
+> echo $datafile
+> done
OUTPUT
@@ -1328,7 +1329,7 @@ Keypoints
Show me the solution
-
+
The correct answer is 3, because the -w
option looks
only for whole-word matches. The other options will also match ‘of’ when
@@ -646,7 +646,7 @@
Show me the solution
-
+
grep -w $1 -r $2 | cut -d : -f 2 | cut -d , -f 1,3 > $1.txt
Actually, you can swap the order of the two cut commands and it still
@@ -696,7 +696,7 @@
Solutions
-
+
for sis in Jo Meg Beth Amy
do
@@ -966,7 +966,7 @@
Show me the solution
-
+
Option 1. is correct. Putting the match expression in quotes prevents
the shell expanding it, so it gets passed to the find
@@ -1045,7 +1045,7 @@
Show me the solution
-
+
- Find all files with a
.dat
extension recursively from
the current directory
diff --git a/instructor/aio.html b/instructor/aio.html
index dcf58231a..2407c4071 100644
--- a/instructor/aio.html
+++ b/instructor/aio.html
@@ -580,7 +580,7 @@
Instructor Note
-
+
Introducing and navigating the filesystem in the shell (covered in Navigating Files and Directories section) can
be confusing. You may have both terminal and GUI file explorer open side
@@ -919,7 +919,7 @@
Show me the solution
-
+
The -l
option makes ls
use a
long listing format, showing not only the
@@ -957,7 +957,7 @@
Show me the solution
-
+
The most recently changed file is listed last when using
-rt
. This can be very useful for finding your most recent
@@ -1310,7 +1310,7 @@
Show me the solution
-
+
- No:
.
stands for the current directory.
@@ -1358,7 +1358,7 @@
Show me the solution
-
+
- No: there is a directory
backup
in
@@ -1406,7 +1406,7 @@
Show me the solution
-
+
- No:
pwd
is not the name of a directory.
@@ -3844,7 +3844,7 @@ KeypointsContent from Loops
- Last updated on 2023-05-16 |
+
Last updated on 2023-07-23 |
Edit this page
Estimated time 50 minutes
@@ -4559,16 +4559,17 @@ BASHSince she’s still learning how to use the shell, she decides to build
up the required commands in stages. Her first step is to make sure that
she can select the right input files — remember, these are ones whose
-names end in ‘A’ or ‘B’, rather than ‘Z’. Starting from her home
-directory, Nelle types:
+names end in ‘A’ or ‘B’, rather than ‘Z’. Moving to the
+north-pacific-gyre
directory, Nelle types:
BASH
-$ cd north-pacific-gyre
-$ for datafile in NENE*A.txt NENE*B.txt
-> do
-> echo $datafile
-> done
+$ cd
+$ cd Desktop/shell-lesson-data/north-pacific-gyre
+$ for datafile in NENE*A.txt NENE*B.txt
+> do
+> echo $datafile
+> done
OUTPUT
@@ -5934,7 +5935,7 @@
Show me the solution
-
+
The correct answer is 3, because the -w
option looks
only for whole-word matches. The other options will also match ‘of’ when
@@ -6036,7 +6037,7 @@
Show me the solution
-
+
grep -w $1 -r $2 | cut -d : -f 2 | cut -d , -f 1,3 > $1.txt
Actually, you can swap the order of the two cut commands and it still
@@ -6086,7 +6087,7 @@
Solutions
-
+
for sis in Jo Meg Beth Amy
do
@@ -6358,7 +6359,7 @@
Show me the solution
-
+
Option 1. is correct. Putting the match expression in quotes prevents
the shell expanding it, so it gets passed to the find
@@ -6437,7 +6438,7 @@
Show me the solution
-
+
- Find all files with a
.dat
extension recursively from
diff --git a/md5sum.txt b/md5sum.txt
index 4f1ceaab7..51bf6fa3c 100644
--- a/md5sum.txt
+++ b/md5sum.txt
@@ -7,7 +7,7 @@
"episodes/02-filedir.md" "84f64bc9d0c8868f573383d5ccfa99d1" "site/built/02-filedir.md" "2023-06-18"
"episodes/03-create.md" "f8cff1c78a401684b728ebea3c36cbec" "site/built/03-create.md" "2023-06-18"
"episodes/04-pipefilter.md" "8f1f5df56fb9ed60db6f33a9793664d5" "site/built/04-pipefilter.md" "2023-07-19"
-"episodes/05-loop.md" "9858630db913016e302d18d2ee2dbfa3" "site/built/05-loop.md" "2023-05-16"
+"episodes/05-loop.md" "aba486ff4e9c3dec7a7d5e121792151a" "site/built/05-loop.md" "2023-07-23"
"episodes/06-script.md" "e214b3c6c95e4b43c7ed6aa7b5a2809a" "site/built/06-script.md" "2023-06-05"
"episodes/07-find.md" "ee2c6b006da9c8a66a850f2e6a720a5d" "site/built/07-find.md" "2023-05-02"
"instructors/instructor-notes.md" "5db2f86826be7c6bba6157eb15a8a881" "site/built/instructor-notes.md" "2023-06-18"
diff --git a/pkgdown.yml b/pkgdown.yml
index 7b6d805a0..2fd5efcfb 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -2,5 +2,5 @@ pandoc: 2.19.2
pkgdown: 2.0.7
pkgdown_sha: ~
articles: {}
-last_built: 2023-07-23T05:44Z
+last_built: 2023-07-23T08:40Z