Thursday, February 1, 2018
Shell Script Character Replace By Next Character
Shell Script Character Replace By Next Character
Write a shell script to encrypt the content of a file using logic .
(i) Replace a character by just next character in the cycle for example A by B ( or a by b), B by C (or b by c), Y by Z (or y by z), Z by A ( or z by a).
(ii) Leave numbers and any other symbols unchanged.
#!/bin/bash
str=""
echo " enter a file name "
read str
cat $str | tr [abcdefghijklmnopqrstuvwxyz] [bcdefghijklmnopqrstuvwxyza] | tr [ABCDEFGHIJKLMNOPQRSTUVWXUZ] [BCDEFGHIJKLMNOPQRSTUVWXUZA] >output.txt
cat output.txt
If you have any Further Information and Quires about this Article dont hesitate to comment in comment box below. AND If you like this article , like our Facebook like page and click +1 to support 123techguide
alternative link download