From ba6dd3256c9508ed0c71c7f3346d910803d54a46 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Thu, 17 Apr 2025 21:19:07 +0200 Subject: update --- .bashrc | 1 + bin/cle | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 4f1e100..9870d56 100644 --- a/.bashrc +++ b/.bashrc @@ -51,6 +51,7 @@ export LESS=iXFRx4 # Stopwatch alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' +alias fd='find . -iname' alias grep='grep -i --color' alias more='less' alias vi='vim' diff --git a/bin/cle b/bin/cle index 1ff9dd0..b26d8b7 100755 --- a/bin/cle +++ b/bin/cle @@ -2,7 +2,14 @@ clip() { print "$1" | tee /dev/tty | head -n 1 | pbcopy; } -del() { rm -i ~/.cle/"$1"; } +checkpath() { set -- $(realpath "$1"); [ "${1#~/.cle/}" != "$1" ]; } + +del() { + set -- ~/.cle/"$1" + checkpath "$1" || die "invalid path $1" + rm -i "$1" + rmdir -p "${1%/*}" 2>/dev/null || true +} die() { echo "$@" >&2; exit 1; } -- cgit v1.2.3