datedir as executable
This commit is contained in:
1
bin/mkdatedir
Symbolic link
1
bin/mkdatedir
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../files/mkdatedir
|
||||||
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