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

make sortip its own script

This commit is contained in:
Connor Olding 2021-08-23 04:51:42 -07:00
parent 954361d9a2
commit dce4a25f12
2 changed files with 11 additions and 1 deletions

View file

@ -173,7 +173,6 @@ alias gc="git column --mode=dense --padding=2" ### @- columnize text by using gi
alias counts='find . | wc -l' ### @- count files in the current directory, including files found recursively.
alias exts="find -type f | grep -o '\\.[^/.]*$' | sort | uniq -c | sort -n" ### @- count and sort file extensions in the current directory, including files found recursively.
alias nocom='grep -Ev --line-buffered --color=never "^[[:space:]]*(//|#)"' ### @- strip single-line C-like and shell-like comments.
alias sortip="sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n" ### @- sort numerically by IPv4 segments.
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.

11
sh/sortip Normal file
View file

@ -0,0 +1,11 @@
#!/usr/bin/sh
# YES_ZSH
# YES_BASH
# YES_DASH
# YES_ASH
sortip() { ### @- sort lines numerically by IPv4 segments.
sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n "$@"
}
[ -n "${preload+-}" ] || sortip "$@"