zsh: add linecount function
This commit is contained in:
parent
6299054903
commit
8b1df582b3
1 changed files with 10 additions and 0 deletions
|
@ -13,6 +13,16 @@ function xsi() {
|
|||
--preview-window=right:66%:wrap | xargs -ro xi
|
||||
}
|
||||
|
||||
function linecount() {
|
||||
filematch=$1
|
||||
|
||||
find . -type f -name "$1" -exec wc -l {} \; |
|
||||
awk -v color="$(tput setab 4; tput setaf 0)" '{ count+=$1; print $2 ": " $1 } END { print color "TOTAL: " count }' |
|
||||
column -t
|
||||
|
||||
tput sgr0
|
||||
}
|
||||
|
||||
function geo() {
|
||||
pos=$(curl -s "https://reallyfreegeoip.org/json/${1}")
|
||||
lat=$(echo "$pos" | jq -r '.latitude')
|
||||
|
|
Loading…
Add table
Reference in a new issue