bashの繰り返し構文で出力ができずにいます。
前段の繰り返し構文では出力もreadも都度できているのに何故なのでしょう、、、
自動化するためにbash便利だけど難しい、、、
#!/bin/bash # setting ## Method list function read_input_and_validation() { read input while [ "$input" = "" ]; do # ここは問題ないのに、、、 echo "It is not yet input." read input done if [ "$1" ]; then while [ ! -d ~/$input ]; do # ↓ディレクトリが存在しなければ以下を実行するがこいつが出力されない。readはできている。 echo "nooooooooo!!!!!!!!!!!!" #echo -e "\e[1;33mThere is no directory named ${input} on home.\e[0;39m" #echo -e "\e[1;33mMake sure that the domain is registered on the server and enter the correct domain.\e[0;39m" read input done fi echo $input } ## Input setting echo -e "\e[5;36m* \e[0m\e[1;36mPlease enter the URL of the remote repository of the clone to be created.\e[0;39m" Clone_url=`read_input_and_validation` echo $Clone_url return echo -e "\e[5;36m* \e[0m\e[1;36mPlease enter an alias for managing the clone to be created.\e[0;39m" Project_name=`read_input_and_validation` echo -e "\e[5;36m* \e[0m\e[1;36mPlease enter the domain name to reflect the setting.\e[0;39m" Domain_name=`read_input_and_validation true` echo $Clone_url,$Project_name,$Domain_name
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/01/30 02:19
2018/01/30 03:05