如何使用脚本传递空字符串。作为 agqmi 开始 0""""""。如果它无法在配置文件中找到设置。并且应用程序不是通过脚本调用的。但通过命令行它的工作(agqmi start 0“”“”“”)。
profile_file
APN='airtelgprs.com'
USR='username'
PASS='password'
PAPCHAP='2'
if [ -f "$PROFILE_FILE" ]; then
echo "Loading profile..." >>$LOG
PAPCHAP=`cat agqmi-network.conf | grep 'PAPCHAP' | awk '{print $1}' | cut -f2
-d"'"`
APN=`cat agqmi-network.conf | grep 'APN' | awk '{print $1}' | cut -f2 -d"'"`
USR=`cat agqmi-network.conf | grep 'USR' | awk '{print $1}' | cut -f2 -d"'"`
PASS=`cat agqmi-network.conf | grep 'PASS' | awk '{print $1}' | cut -f2 -d"'"`
if [ "x$PAPCHAP" == "x" ]; then
PAPCHAP="0"
fi
if [ "x$APN" == "x" ]; then
APN="\"\""
fi
if [ "x$USR" == "x" ]; then
USR="\"\""
fi
if [ "x$PASS" == "x" ]; then
PASS="\"\""
fi
fi
我试图执行
STATUS_CMD="./agqmi start "$PAPCHAP" "$APN" "$USR" "$PASS""
echo "$STATUS_CMD" >>$LOG
`$STATUS_CMD`