Skip to content

Commit dd19aa7

Browse files
committed
Add tr transformations for text exercises
- script-01.sh: replace all '!' with '.' using tr. - script-02.sh: swap Y and Z (both upper and lower case) using tr.
1 parent b655cd4 commit dd19aa7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

shell-pipelines/tr/script-01.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ set -euo pipefail
66
# The author got feedback that they're using too many exclamation marks (!).
77
#
88
# TODO: Write a command to output the contents of text.txt with every exclamation mark (!) replaced with a full-stop (.).
9+
10+
tr '!' '.' < ./text.txt

shell-pipelines/tr/script-02.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ set -euo pipefail
77
# so every Y should be a Z, and every Z should be a Y!
88
#
99
# TODO: Write a command to output the contents of text.txt with every Y and Z swapped (both upper and lower case).
10+
11+
tr 'YZyz' 'ZYzy' < ./text.txt

0 commit comments

Comments
 (0)