#!/bin/bash
# Setup Variables
hostName=localhost
portNum=8080
SOLRPATH=/solr
SOLR='delta-import&clean=false'
STATUS='dataimport?command=status'
urlCmd='http://${hostName}:${portNum}${SOLRPATH}/dataimport?command=${SOLRCMD}"
statusCmd='http://${hostName}:${portNum}${SOLRPATH}/dataimport?command=${STATUS}"
myStdErrLog=/tmp/myProject/myProg.stderr.$(/bin/date +%Y%m%d.%H%M)
outputDir=.
# Operations
wget -O $outputDir/check_status_update_index.txt ${statusCmd} 2> ${myStdErrLog}
status=$(fgrep idle $outputDir/check_status_update_index.txt)
case "${status}" in
*idle* ) .... ;;
* ) echo "unknown status = ${status} or similar" 1>&2 ;;
esac
我真正理解的是,我们从变量中获得了 urlcmd 和 statuscmd,但我不明白该操作的作用。任何人都可以解释一下吗?