datedir as executable
This commit is contained in:
14
files/mkdatedir
Executable file
14
files/mkdatedir
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
if [[ "$1" = "--help" ]]; then
|
||||
echo 'Creates a dir with "%Y-%m-%d-[argument], in the current folder."'
|
||||
echo 'Without argument, just the date is used'
|
||||
exit
|
||||
fi
|
||||
printf -v dirbase "%(%Y-%m-%d)T" -1;
|
||||
if [[ -n "$1" ]]; then
|
||||
dirbase="$dirbase"-"$1";
|
||||
fi;
|
||||
mkdir "$dirbase";
|
||||
echo $dirbase/
|
||||
|
||||
Reference in New Issue
Block a user