1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 06:29:02 -08:00
rc/sh/rot13

20 lines
428 B
Text
Raw Normal View History

2021-08-01 19:34:45 -07:00
#!/usr/bin/env sh
# compat: +ash +bash +dash +zsh
2021-09-23 06:48:05 -07:00
# works with busybox tr.
2021-08-01 19:34:45 -07:00
rot13() { ### @-
### rot13 with numbers rotated as well.
###
### ```
### $ rot13 <<< abc123
### nop678
### ```
###
### **NOTE:** there also exists rot13(1) programs provided by
### the *bsdgames* and *hxtools* packages that i don't use.
2021-08-01 19:34:45 -07:00
tr -- A-Za-z0-9 N-ZA-Mn-za-m5-90-4
}
[ -n "${preload+-}" ] || rot13 "$@"