2016-02-10 180 views
-1

当我运行此脚本在MySQL中更新表,它抛出这个错误:错误Shell脚本

facilitycreation.sh: line 3: echo_________________: command not found 
facilitycreation.sh: line 8: unexpected EOF while looking for matching `'' 
facilitycreation.sh: line 10: syntax error: unexpected end of file 

有人能告诉我什么是错误吗?

#!/bin/bash 
echo "Facility Creation" 
echo"_________________" 
while read address_line1 address_line2 city state country postal_code 
do 
echo`mysql -u**** -h********* facilities -e "insert into addresses ($'address_line1',$'address_line2',$'city',$'state',$'country',$'postal_code',now(),now());"` 

slepp 10 

echo 'mysql -u**** -h****** facilities -e "Select * form addresses where city =$'city';` 
done < details.txt 

details.txt文件具有这种格式的细节:

add1 
add2 
cityname 
Statename 
Pincode 
India 
+1

这是不可读的,获取格式正确,否则我们将无法帮助您。 – hgiesel

回答

0

的空间被你的电话之间缺少呼应和字符​​串:

echo"_________________" 

将被Bash解释为

echo_________________ 

作为一个方面说明,这里没有必要使用双引号