Skip to content

Commit 874ebdd

Browse files
committed
some changes applied
1 parent 8ba277e commit 874ebdd

File tree

7 files changed

+14
-4
lines changed

7 files changed

+14
-4
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ set -euo pipefail
99
# 1 It looked delicious.
1010
# 2 I was tempted to take a bite of it.
1111
# 3 But this seemed like a bad idea...
12+
13+
cat -n ../helper-files/helper-3.txt

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

Whitespace-only changes.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ set -euo pipefail
44

55
# TODO: Write a command which lists all of the files in the directory named child-directory.
66
# The output should be a list of names: helper-1.txt, helper-2.txt, helper-3.txt.
7+
8+
ls child-directory

individual-shell-tools/ls/script-04.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ echo "First exercise (sorted newest to oldest):"
1616
# TODO: Write a command which lists the files in the child-directory directory, one per line, sorted so that the most recently modified file is first.
1717
# The output should be a list of names in this order, one per line: helper-3.txt, helper-1.txt, helper-2.txt.
1818

19-
ls -t1
19+
ls -t1 child-directory
2020
echo "Second exercise (sorted oldest to newest):"
2121

2222
# TODO: Write a command which does the same as above, but sorted in the opposite order (oldest first).
2323
# The output should be a list of names in this order, one per line: helper-2.txt, helper-1.txt, helper-3.txt.
24-
ls -tr1
24+
ls -tr1 child-directory

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ set -euo pipefail
66
# The output should contain 11 lines.
77
# The first line of the output should be: "ThIs Is a sample fIle for experImentIng with sed.".
88

9-
sed s/i/I/g ./input.txt
9+
sed s/i/I/g ./input.txt
10+
11+
# **** FYI: In the line 7,it seems there is a mistake, as example for output looks like `with` is not replaced with `wIth`, but it should be replaced. ****

individual-shell-tools/sed/script-04.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ set -euo pipefail
55
# TODO: Write a command to output input.txt replacing every occurrence of the string "We'll" with "We will".
66
# The output should contain 11 lines.
77

8-
sed "s/We'll/We will/" input.txt
8+
# as here we got only one occurance:
9+
sed "s/We'll/We will/" input.txt
10+
# But if there was more occurance, the code would be:
11+
sed "s/We'll/We will/g" input.txt

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +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

0 commit comments

Comments
 (0)