【发布时间】:2019-04-17 20:42:45
【问题描述】:
如果你去这个网址:http://artii.herokuapp.com/fonts_list,你会在列表中看到一个包含 417 个项目的列表。
我正在尝试创建一个变量来存储/访问这些列表。
我无法让它工作。
fontList=$(curl http://artii.herokuapp.com/fonts_list)
fontListCount=$(curl http://artii.herokuapp.com/fonts_list | wc -l)
for i in $(seq 1 $fontListCount);
do
echo -e "I like this font --> " fontList[$i]
done
我一直在得到
I like this font --> fontList[1]
...
I like this font --> fontList[417]
关于如何做的任何提示?
【问题讨论】:
-
当我访问该页面时,我会得到
Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command heroku logs --tail
标签: arrays linux bash unix curl