Improved awkuniq alias and fixed some other bugs
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
shellAliases = {
|
||||
cd = "z";
|
||||
ls = "eza";
|
||||
awkuniq = "sort | uniq";
|
||||
histogram = "awkuniq -c | sort -nr";
|
||||
json-less = "jq -C . | less -R";
|
||||
csv2json = "python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))'";
|
||||
@@ -61,6 +60,15 @@
|
||||
if [[ -n "$SSH_CONNECTION" && "$TERM" == "ghostty" ]]; then
|
||||
export TERM="xterm-256color"
|
||||
fi
|
||||
|
||||
awkuniq() {
|
||||
if [[ "$1" == "-c" ]]; then
|
||||
awk '{ !x[$0]++ } END { for (i in x) print x[i] "\t" i }'
|
||||
else
|
||||
awk '!x[$0]++'
|
||||
fi
|
||||
}
|
||||
|
||||
'';
|
||||
|
||||
plugins = [
|
||||
|
||||
Reference in New Issue
Block a user