【发布时间】:2015-01-30 09:08:17
【问题描述】:
首先我看到了与这个类似的问题。我已经遵循了这些线程的解决方案。但我仍然无法修复它。我想从属性文件的键中删除点(。)。可以有人帮助确定问题
我有一个属性文件 tempds.properties
#Fri Jan 30 07:37:25 CET 2015
ds.home=/opt/abc
mykey=/opt/xyz
我使用另一个脚本 test.sh
cd /opt
chmod 777 tempds.properties
#awk -F= -vOFS="=" 'gsub(/\./,"_",$1)+1' tempds.properties
cat tempds.properties| sed 's/\./_/g' > .tempds.properties
echo "Processing "
for i in {1..5}; do
sleep 1
echo "..........."
done
. /opt/tempds.properties
echo $ds_home
echo $mykey
echo "Process finishd"
输出:
root@onebox:/opt# sudo ./test.sh
Processing
...........
./test.sh: 2: /opt/tempds.properties: ds.home=/opt/abc: not found
/opt/xyz
Process finishd
【问题讨论】:
标签: linux bash shell unix terminal