我正在尝试读取此文件 (env.cfg)
AXXL_EXCHANGE="/home/company/RECETTE/data"
HOME_LOG="/home/company/RECETTE/logs"
PXXWS_ALERT=user@company.com
PXXWS_DAV=https://URL/ascl/webdav
PXXWS_URL=https://URL/ascl/services
PXXWS_PEM=/home/folder/RECETTE/conf
PXXWS_XSLT=/home/folder/RECETTE/conf
PXXWS_PWD=
PXXWS_CURL="-m 3600 -k" # max-time 3600 (tests)
TMP_DIR=/tmp
使用以下 bash 脚本 (RES.sh)
#!/bin/bash
FILE=$1
# read $FILE using the file descriptors
exec 3<&0
exec 0<$FILE
while read line
do
# use $line variable to process line
echo $line
done
exec 0<&3
这是脚本回显的内容(在控制台上)
AXXL_EXCHANGE="/home/company/RECETTE/data"
HOME_LOG="/home/company/RECETTE/logs"
PXXWS_ALERT=user@company.com
PXXWS_DAV=https://URL/ascl/webdav
PXXWS_URL=https://URL/ascl/services
PXXWS_PEM=/home/folder/RECETTE/conf
PXXWS_XSLT=/home/folder/RECETTE/conf
PXXWS_PWD=
PXXWS_CURL=
TMP_DIR=/tmp
最后一行 (PASWS_CURL) 右侧缺失
环境:debian wheezy 谢谢