Add some basic common utilities
This commit is contained in:
parent
5fbe0c7b41
commit
85ed203292
1 changed files with 24 additions and 0 deletions
24
dotlib/post/util.sh
Normal file
24
dotlib/post/util.sh
Normal file
|
@ -0,0 +1,24 @@
|
|||
ll() {
|
||||
command ls -AlF "$@"
|
||||
}
|
||||
|
||||
ssh() {
|
||||
TERM=xterm-256color command ssh "$@"
|
||||
}
|
||||
|
||||
awk-find() {
|
||||
if (( $# > 1 )); then
|
||||
local find_in=${TO_FIND:-.} file pattern=$1 to_find=( )
|
||||
|
||||
for file in "${@:2}"; do
|
||||
to_find+=(-name "$file" -o)
|
||||
done
|
||||
|
||||
find "$find_in" -not -name . "(" "${to_find[@]::${#to_find[@]} - 1}" ")" -print0 |
|
||||
awk -F / -v RS="\0" "$pattern"
|
||||
fi
|
||||
}
|
||||
|
||||
clbin() {
|
||||
tail -n +1 -- "$@" | curl -sSF 'clbin=<-' https://clbin.com
|
||||
}
|
Loading…
Reference in a new issue