質問編集履歴

1

追記

2020/03/16 00:28

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -147,3 +147,89 @@
147
147
 
148
148
 
149
149
  ```
150
+
151
+ ---
152
+
153
+ 追記 (動かないスクリプト, zshrcの関連部分, zmodloadの出力)
154
+
155
+ ```zsh
156
+
157
+ #!/usr/local/bin/zsh
158
+
159
+ urls="
160
+
161
+ https://www.youtube.com/watch?v=sample1
162
+
163
+ https://www.youtube.com/watch?v=sample2
164
+
165
+ https://www.youtube.com/watch?v=sample3
166
+
167
+ "
168
+
169
+ echo "$urls"
170
+
171
+ mapfile -t parsed_urls <<< "$urls" # download.sh:8: command not found: mapfileとなる
172
+
173
+
174
+
175
+ for url in "${parsed_urls[@]}"; do
176
+
177
+ echo "$url"
178
+
179
+ youtube-dl "$url"
180
+
181
+ printf "\n"
182
+
183
+ done
184
+
185
+ ```
186
+
187
+
188
+
189
+ ```zshrc
190
+
191
+ ...
192
+
193
+ # enable mapfile
194
+
195
+ zmodload zsh/mapfile
196
+
197
+ ...
198
+
199
+ ```
200
+
201
+
202
+
203
+ ```terminal
204
+
205
+ ❯ zmodload
206
+
207
+ zsh/complete
208
+
209
+ zsh/complist
210
+
211
+ zsh/computil
212
+
213
+ zsh/datetime
214
+
215
+ zsh/main
216
+
217
+ zsh/mapfile
218
+
219
+ zsh/parameter
220
+
221
+ zsh/regex
222
+
223
+ zsh/terminfo
224
+
225
+ zsh/zle
226
+
227
+ zsh/zleparameter
228
+
229
+ zsh/zpty
230
+
231
+ zsh/zutil
232
+
233
+
234
+
235
+ ```