Skip to content

Commit f27713d

Browse files
author
Julia
committed
Using tr command for transforming strings
1 parent ddacb33 commit f27713d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

text/cut.sh text/modify.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,11 @@ cut -f1-3 -d ',' <<<$str
1010
echo "Give me a sentence and I will write first 3 words"
1111
read str
1212
# TAB is the default delimiter, but to specify it $"\t"
13-
cut -f1-3 -d" " <<<$str
13+
cut -f1-3 -d" " <<<$str
14+
15+
16+
# tr is a translator
17+
# delete all digits
18+
tr -d [0-9]
19+
# supress multiple spaces
20+
tr -s " "

0 commit comments

Comments
 (0)