Results 1 to 2 of 2
Hi,
i have this script below. When i execute it, i get these errors:
Code:
89.17.206.129
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; ...
- 07-08-2009 #1Just Joined!
- Join Date
- Apr 2007
- Posts
- 22
Bash with MySQL sintax
Hi,
i have this script below. When i execute it, i get these errors:
Code:89.17.206.129 ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.206.129 )' at line 5 89.17.206.130 ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.206.130 )' at line 5 89.17.206.131 ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.206.131 )' at line 5
I dont get any error when i write manually at mysql prompt this:
This is the bash code:Code:mysql> INSERT INTO `pingp22`.`ip` ( `ip` ) VALUES ( "89.17.206.129" );
Any idea?Code:IPS="$(seq -f "89.17.206.%.0f" 129 189) $(seq -f "89.17.219.%.0f" 65 126)" for i in ${IPS} do if [ -z "$(nmap -p 22 $i |grep closed)" ]; then BD="pingp22" echo $i mysql -uroot -pm -D $BD -Bse 'INSERT INTO `pingp22`.`ip` ( `ip` ) VALUES ( '$i' ); ' fi done
Ciao
- 07-08-2009 #2Just Joined!
- Join Date
- Apr 2007
- Posts
- 22
Ok, i forgot quoting $i this way "$i".


Reply With Quote