Skip to content

Instantly share code, notes, and snippets.

@no1fushi
Last active June 2, 2020 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save no1fushi/ef704af3f1d8430b674a8eaeb970aa1f to your computer and use it in GitHub Desktop.
Save no1fushi/ef704af3f1d8430b674a8eaeb970aa1f to your computer and use it in GitHub Desktop.
#!/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