From 24f0306660564d783b54e12ddd9f6f7003871fe0 Mon Sep 17 00:00:00 2001 From: Gianni Bombelli Date: Wed, 7 Nov 2018 00:28:23 +0100 Subject: [PATCH] add another solution using tr and Character Classes --- rot13/solution.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rot13/solution.md b/rot13/solution.md index 8ee57ea..305dae2 100644 --- a/rot13/solution.md +++ b/rot13/solution.md @@ -5,3 +5,9 @@ One possible approach is to use the `tr` command that translates a set of charac Also `sed` has the same ability with the `y` command ```echo cypher me | sed 'y/abcdefghijklmnopqrstuvwxyz/nopqrstuvwxyzabcdefghijklm/'``` + +Using the **Character Classes** is possible to avoid writing all the letters of the alphabet and it is also possible to manage easly the case of the character! + +```bash +echo cypher ME | tr a-zA-Z n-za-mN-ZA-N +```