cd documents/quoteUpdate
while true
do
curl -o quotes.txt -s "http://download.finance.yahoo.com/d/quotes.csv?s=goog,aapl&f=sl1c1p2pt1"
echo UPDATED:
date
sleep 10
done
答案1
您可以使用sed
来编辑 quotes.txt。此示例将所有逗号更改为空格字符 (s/,/ /g)。原始文件的备份名为 quotes.txt.bak。
cd documents/quoteUpdate
while true
do
curl -o quotes.txt -s "http://download.finance.yahoo.com/d/quotes.csv?s=goog,aapl&f=sl1c1p2pt1"
sed -i '.bak' 's/,/ /g' quotes.txt # replace commas with spaces
echo UPDATED:
date
sleep 10
done