Command for shenanigans

This commit is contained in:
Geoffrey Frogeye 2025-09-23 00:08:46 +02:00
parent 1a8c9d7c5a
commit 99e0927c00
2 changed files with 19 additions and 0 deletions

View file

@ -110,3 +110,12 @@ setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording en
unsetopt HIST_VERIFY # Don't execute immediately upon history expansion.
unsetopt HIST_BEEP # Beep when accessing nonexistent history.
# Replace the content of a symlinked file
# Useful for ad-hoc replacing of Nix config files
subl() {
[ -f "$1" ] || return 3
[ -h "$1" ] || return 4
src="$(readlink -f "$1")"
rm "$1"
< "$src" > "$1"
}