diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-08-07 23:00:20 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-08-07 23:00:20 -0300 |
commit | 97489951642ef04c5d6384f014d8fae0bb4aa8bb (patch) | |
tree | 206c936e7f122e7598fda6f4e514178ffea38aa0 | |
parent | 79668ee7b06835f94c261f362146f1ee786efbb3 (diff) | |
download | profile-97489951642ef04c5d6384f014d8fae0bb4aa8bb.tar.gz profile-97489951642ef04c5d6384f014d8fae0bb4aa8bb.tar.bz2 |
Feat: new ISO date commands
-rw-r--r-- | aliases.dot.link | 2 | ||||
-rw-r--r-- | profile.dot.link | 22 |
2 files changed, 24 insertions, 0 deletions
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 "$*" } |