diff options
| author | DrNuget <drnuget@outlook.com> | 2025-11-15 02:49:36 +0200 |
|---|---|---|
| committer | DrNuget <drnuget@outlook.com> | 2025-11-15 02:49:36 +0200 |
| commit | 18dcd20ef93e2e1e138ffc1ac6056758e164c025 (patch) | |
| tree | 26790f96dfd14c5abf43df3bff50ea0b21d421ec | |
| parent | 89ddb8ac56b810c53844b831fcb1014b11161ba2 (diff) | |
| download | scripts-18dcd20ef93e2e1e138ffc1ac6056758e164c025.tar.gz | |
ROT make script not omit non alphabet characters
| -rwxr-xr-x | scripts/rot | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/rot b/scripts/rot index 627ef62..aae6ec8 100755 --- a/scripts/rot +++ b/scripts/rot @@ -11,7 +11,7 @@ while [ $# -gt 0 ]; do shift ;; *) - DATA="$DATA$1" + DATA="$DATA $1" shift ;; esac @@ -37,7 +37,12 @@ BEGIN { result=""; split($0, chars, ""); for (i=1;i<=length($0);i++) { - result=result cipher_map[chars[i]]; + if (chars[i] in cipher_map) { + result=result cipher_map[chars[i]]; + } + else { + result=result chars[i]; + } } print result; } |
