⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 quote-fetch.sh

📁 Shall高级编程
💻 SH
字号:
#!/bin/bash# quote-fetch.sh: Download a stock quote.E_NOPARAMS=66if [ -z "$1" ]  # Must specify a stock (symbol) to fetch.  then echo "Usage: `basename $0` stock-symbol"  exit $E_NOPARAMSfistock_symbol=$1file_suffix=.html# Fetches an HTML file, so name it appropriately.URL='http://finance.yahoo.com/q?s='# Yahoo finance board, with stock query suffix.# -----------------------------------------------------------wget -O ${stock_symbol}${file_suffix} "${URL}${stock_symbol}"# -----------------------------------------------------------# To look up stuff on http://search.yahoo.com:# -----------------------------------------------------------# URL="http://search.yahoo.com/search?fr=ush-news&p=${query}"# wget -O "$savefilename" "${URL}"# -----------------------------------------------------------# Saves a list of relevant URLs.exit $?# Exercises:# ---------## 1) Add a test to ensure the user running the script is on-line.#    (Hint: parse the output of 'ps -ax' for "ppp" or "connect."## 2) Modify this script to fetch the local weather report,#+   taking the user's zip code as an argument.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -