From 97489951642ef04c5d6384f014d8fae0bb4aa8bb Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 7 Aug 2024 23:00:20 -0300 Subject: Feat: new ISO date commands --- aliases.dot.link | 2 ++ profile.dot.link | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/aliases.dot.link b/aliases.dot.link index 7045c94..09a5536 100644 --- a/aliases.dot.link +++ b/aliases.dot.link @@ -8,7 +8,9 @@ alias gvim="vim.gtk -g &> /dev/null" alias music="ncmpcpp" alias mkdir="mkdir -p" alias today="date +%Y%m%d" +alias todayiso="date --iso-8601" alias month="date +%Y%m" +alias monthiso="date +%Y-%m" alias now="date +%Y%m%d%H%M%S" alias hashpw="mkpasswd -m sha-512" alias stitle="screen -X title" diff --git a/profile.dot.link b/profile.dot.link index bc7586e..4c5c866 100644 --- a/profile.dot.link +++ b/profile.dot.link @@ -234,6 +234,17 @@ mkday() { mkdir $folder && cd $folder } +mkdayiso() { + suffix="$1" + folder="`todayiso`" + + if [ ! -z "$suffix" ]; then + folder="$folder-$suffix" + fi + + mkdir $folder && cd $folder +} + mkmonth() { suffix="$1" folder="`month`" @@ -245,6 +256,17 @@ mkmonth() { mkdir $folder && cd $folder } +mkmonthiso() { + suffix="$1" + folder="`monthiso`" + + if [ ! -z "$suffix" ]; then + folder="$folder-$suffix" + fi + + mkdir $folder && cd $folder +} + mkcd() { mkdir "$*" && cd "$*" } -- cgit v1.2.3