Last active
June 2, 2020 05:31
-
-
Save no1fushi/ef704af3f1d8430b674a8eaeb970aa1f to your computer and use it in GitHub Desktop.
For the blog ( https://no1fushi.hateblo.jp/entry/2019/12/21/130328 )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function input() { | |
local dir | |
read -p " ->" dir | |
echo $dir | |
} | |
function checkDir() { | |
if [ -d ./$1 ]; then | |
echo "The input directory exists." | |
echo "Type it again." | |
echo "Please enter a directory name." | |
local dir=`input` | |
checkDir $dir | |
else | |
mkdir $1 | |
touch $1/report$1.txt | |
echo クラス 出席番号番 名字 名前 テーマ$1 レポート > $1/report$1.txt | |
fi | |
} | |
if [ $# != 1 ]; then | |
echo "Please enter a directory name." | |
dir=`input` | |
checkDir $dir | |
else | |
checkDir $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment