2021/init-day.sh

23 lines
248 B
Bash
Raw Permalink Normal View History

2021-12-01 14:56:21 +01:00
#!/bin/sh
BASEDIR=$(dirname "$0")
if [ ! -z "$1" ]
then
DAY=$(printf "%02d" "$1")
else
DAY=$(date +%d)
fi
cd $BASEDIR/
if [ ! -d $DAY ]
then
mkdir $DAY
fi
if [ ! -f $DAY/script.rb ]
then
sed "s/NB/$DAY/" template.rb >$DAY/script.rb
fi