summaryrefslogtreecommitdiff
path: root/lib/functions.zsh
diff options
context:
space:
mode:
authorKevin Burke <kevin@burke.dev>2021-11-09 00:04:10 -0800
committerGitHub <noreply@github.com>2021-11-09 09:04:10 +0100
commite86c6f5e7fc9f024a427e2870ab70644b5454725 (patch)
treebde5878b37dc151ae8643ef0473ea90a0d89a830 /lib/functions.zsh
parent55682e36920e2ab7633fc6eee11466d3faed0bf8 (diff)
downloadzsh-e86c6f5e7fc9f024a427e2870ab70644b5454725.tar.gz
zsh-e86c6f5e7fc9f024a427e2870ab70644b5454725.tar.bz2
zsh-e86c6f5e7fc9f024a427e2870ab70644b5454725.zip
style: use `-n` flag in `head` and `tail` commands (#10391)
Co-authored-by: Marc Cornellà <hello@mcornella.com>
Diffstat (limited to 'lib/functions.zsh')
-rw-r--r--lib/functions.zsh4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/functions.zsh b/lib/functions.zsh
index 73b491a59..fc53611b8 100644
--- a/lib/functions.zsh
+++ b/lib/functions.zsh
@@ -1,7 +1,7 @@
function zsh_stats() {
fc -l 1 \
| awk '{ CMD[$2]++; count++; } END { for (a in CMD) print CMD[a] " " CMD[a]*100/count "% " a }' \
- | grep -v "./" | sort -nr | head -20 | column -c3 -s " " -t | nl
+ | grep -v "./" | sort -nr | head -n 20 | column -c3 -s " " -t | nl
}
function uninstall_oh_my_zsh() {
@@ -45,7 +45,7 @@ function takeurl() {
data="$(mktemp)"
curl -L "$1" > "$data"
tar xf "$data"
- thedir="$(tar tf "$data" | head -1)"
+ thedir="$(tar tf "$data" | head -n 1)"
rm "$data"
cd "$thedir"
}