スクリプトを使用して null 文字列を渡す方法。agqmi start 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`