From 21a13652df728c9571f899caf4949d5d46f49db7 Mon Sep 17 00:00:00 2001 From: johannst Date: Wed, 1 May 2024 17:39:45 +0000 Subject: deploy: 7ca41565c4e70b212cb88a4d18c18fa35768df6d --- cli/tr.html | 258 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 258 insertions(+) create mode 100644 cli/tr.html (limited to 'cli/tr.html') diff --git a/cli/tr.html b/cli/tr.html new file mode 100644 index 0000000..e3d197b --- /dev/null +++ b/cli/tr.html @@ -0,0 +1,258 @@ + + + + + + tr - Notes + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+
+

tr(1)

+
tr [opt] str1 [str2]
+    -d      delete characters in str1
+    -s      squeeze repeating sequence of characters in str1
+
+

Examples

+

To lower

+
echo MoOsE | tr '[:upper:]' '[:lower:]'
+# output: moose
+
+

Replace characters

+
echo moose | tr 'o' '-'
+# output: m--se
+
+echo moose | tr 'os' '-'
+# output: m---e
+
+

Remove specific characters

+
echo moose | tr -d 'o'
+# output: mse
+
+echo moose | tr -d 'os'
+# output: me
+
+

Squeeze character sequences

+
echo moooooossse | tr -s 'os'
+# output: mose
+
+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + +
+ + -- cgit v1.2.3