質問編集履歴

3

sどぇd

2018/01/29 13:30

投稿

earnest_gay
earnest_gay

スコア615

test CHANGED
File without changes
test CHANGED
@@ -145,3 +145,87 @@
145
145
  *execでの変数に代入されていないと思われる件の追記。
146
146
 
147
147
  ![イメージ説明](a8de764783e92e716c8d38824ae27916.png)
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+ 本題から離れていってる気がするので、、、教えていただいた記述を例にメソッドを切り分けたいのですが、入力時も未入力時も動作がおかしいのです、、、
160
+
161
+
162
+
163
+ ```ここに言語を入力
164
+
165
+ function read_input ()
166
+
167
+ {
168
+
169
+ read input
170
+
171
+ rtn_check_blank=$(check_blank) $input
172
+
173
+
174
+
175
+ # 関数の返却値を標準出力に出力
176
+
177
+ echo $rtn_check_blank
178
+
179
+ }
180
+
181
+
182
+
183
+ function check_blank ()
184
+
185
+ {
186
+
187
+ input=$1
188
+
189
+ while [ "$input" = "" ];
190
+
191
+ do
192
+
193
+ echo "It is not yet input."
194
+
195
+ read input
196
+
197
+ done
198
+
199
+ echo $input
200
+
201
+ }
202
+
203
+
204
+
205
+ ## Input setting
206
+
207
+ 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"
208
+
209
+ Clone_url=$(read_input)
210
+
211
+
212
+
213
+ echo -e "\e[5;36m* \e[0m\e[1;36mPlease enter an alias for managing the clone to be created.\e[0;39m"
214
+
215
+ Project_name=$(read_input)
216
+
217
+
218
+
219
+ echo -e "\e[5;36m* \e[0m\e[1;36mPlease enter the domain name to reflect the setting.\e[0;39m"
220
+
221
+ Domain_name=$(read_input)
222
+
223
+
224
+
225
+ echo $Clone_url,$Project_name,$Domain_name
226
+
227
+ ```
228
+
229
+
230
+
231
+ ![イメージ説明](8b55ce6a80ab873b8c783e0eab5e4dde.png)

2

えd3r

2018/01/29 13:30

投稿

earnest_gay
earnest_gay

スコア615

test CHANGED
File without changes
test CHANGED
@@ -131,3 +131,17 @@
131
131
  みたいなことをやってもうまくいかず、、、
132
132
 
133
133
  知恵をお貸しいただきたく、、、
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+ *execでの変数に代入されていないと思われる件の追記。
146
+
147
+ ![イメージ説明](a8de764783e92e716c8d38824ae27916.png)

1

え2で

2018/01/29 13:06

投稿

earnest_gay
earnest_gay

スコア615

test CHANGED
File without changes
test CHANGED
@@ -128,4 +128,6 @@
128
128
 
129
129
 
130
130
 
131
- みたいなこと
131
+ みたいなことをやってもうまくいかず、、、
132
+
133
+ 知恵をお貸しいただきたく、、、