From f0735b5d912c72e0b56bc49d4f413d30efdb954d Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 13 Feb 2022 21:30:25 +0300 Subject: [PATCH 1/1] zsh built-in strftime --- bin/bin/zsnap.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}) -- 2.44.0