1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 04:19:03 -08:00

make rot13 its own function, document

This commit is contained in:
Connor Olding 2021-08-01 19:34:45 -07:00
parent c295d2b495
commit d6300c4578
2 changed files with 16 additions and 1 deletions

View file

@ -173,7 +173,6 @@ alias sortip="sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n" ### @- sort numerically
alias jrep='grep -aPo "[\x{20}-\x{7E}\x{4E00}-\x{9FFF}\x{3040}-\x{30FF}]+"' ### @- extract strings comprised of basic ASCII or Japanese codepoints.
alias bomb='uconv -f utf-8 -t utf-8 --add-signature' ### @- add a Byte-Order Mark to a file.
alias cleanse='tr -cd "\11\12\15\40-\176"' ### @- strip unprintable and non-ASCII characters.
alias rot13='tr "A-Za-z0-9" "N-ZA-Mn-za-m5-90-4"' ### @- rot13 with numbers rotated as well.
alias unwrap='awk '\''BEGIN{RS="\n\n";FS="\n"}{for(i=1;i<=NF;i++)printf "%s ",$i;print "\n"}'\' ### @- join paragraphs into one line each.
alias double='awk "{print;print}"' ### @- print every line twice. <br/> print every line twice.
alias join2='paste -d" " - -' ### @- join every other line.

16
sh/rot13 Normal file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env sh
# YES_ZSH
# YES_BASH
# YES_DASH
rot13() { ### @-
### rot13 with numbers rotated as well.
###
### ```
### $ rot13 <<< abc123
### nop678
### ```
tr -- A-Za-z0-9 N-ZA-Mn-za-m5-90-4
}
[ "${SOURCING:-0}" -gt 0 ] || rot13 "$@"