From: Sergey Matveev Date: Sun, 13 Feb 2022 18:30:25 +0000 (+0300) Subject: zsh built-in strftime X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=commitdiff_plain;h=f0735b5d912c72e0b56bc49d4f413d30efdb954d zsh built-in strftime --- diff --git a/bin/bin/zsnap.zsh b/bin/bin/zsnap.zsh index 0182a53..67fff3c 100755 --- a/bin/bin/zsnap.zsh +++ b/bin/bin/zsnap.zsh @@ -21,7 +21,8 @@ enccmd=(~stargrave/bin/gpg-e-fast.sh --recipient offline) what=$1 action=$2 -now=$(date "+%Y%m%d%H%M") +zmodload -F zsh/datetime b:strftime +now=$(strftime %Y%m%d%H%M) [[ $what =~ / ]] && depth=1 || depth=${#${(s./.)what}} snaps=$(zfs list -t snap -d $depth -o name -H | grep $what | sort -nr) snaps=(${(f)snaps})