15 lines
310 B
Bash
Executable File
15 lines
310 B
Bash
Executable File
#!/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/
|
|
|