Skip to content

Commit 1a6c214

Browse files
committed
Refactor file paths in scripts to use relative paths for helper files
1 parent 79e8774 commit 1a6c214

6 files changed

Lines changed: 9 additions & 24 deletions

File tree

individual-shell-tools/cat/script-01.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,4 @@ set -euo pipefail
55
# TODO: Write a command to output the contents of the helper-1.txt file inside the helper-files directory to the terminal.
66
# The output of this command should be "Once upon a time...".
77

8-
mkdir helper-files
9-
cd helper-files
10-
cat > helper-1.txt
11-
Once upon a time...
12-
press the return key and then control+D
8+
cat ../helper-files/helper-1.txt

individual-shell-tools/cat/script-02.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,4 @@ set -euo pipefail
1313
# But this seemed like a bad idea...
1414

1515

16-
cat > helper-2.txt
17-
There was a house made of gingerbread.
18-
cat > helper-3.txt
19-
It looked delicious.
20-
cat > helper-4.txt
21-
I was tempted to take a bite of it.
22-
cat >helper-5.txt
23-
But this seemed like a bad idea...
24-
helper-files % cd ..
25-
% cat helper-files/*
26-
There was a house made of gingerbread.It looked delicious.
27-
I was tempted to take a bite of it.
28-
But this seemed like a bad idea...
16+
cat ../helper-files/*

individual-shell-tools/cat/script-03.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set -euo pipefail
1010
# 2 I was tempted to take a bite of it.
1111
# 3 But this seemed like a bad idea...
1212

13-
cd helper-files
14-
helper-files % cat -n helper-3.txt
15-
1 It looked delicious.
13+
14+
cat -n ../helper-files/helper-3.txt
15+
1616

individual-shell-tools/wc/script-01.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -euo pipefail
44

55
# TODO: Write a command to output the number of words in the file helper-files/helper-3.txt.
66
# The output should include the number 19. The output should not include the number 92.
7-
wc -w helper-files/helper-3.txt
7+
wc -w ../helper-files/helper-3.txt

individual-shell-tools/wc/script-02.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -euo pipefail
44

55
# TODO: Write a command to output the number of lines in the file helper-files/helper-3.txt.
66
# The output should include the number 3. The output should not include the number 19.
7-
wc -l helper-files/helper-3.txt
7+
wc -l ../helper-files/helper-3.txt

individual-shell-tools/wc/script-03.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ set -euo pipefail
88
# 1 7 39 ../helper-files/helper-2.txt
99
# 3 19 92 ../helper-files/helper-3.txt
1010
# 5 30 151 total
11-
wc helper-files/*
11+
12+
wc ../helper-files/*

0 commit comments

Comments
 (0)