tirengarfio
July 8th, 2009, 07:44 PM
Hi,
i have the bash script below. When i execute it i get these errors:
89.17.206.129
ERROR 1102 (42000): Incorrect database name '+%Y-%m-%d %H:%M:%S
);
'
89.17.206.130
ERROR 1102 (42000): Incorrect database name '+%Y-%m-%d %H:%M:%S
);
'
89.17.206.131
ERROR 1102 (42000): Incorrect database name '+%Y-%m-%d %H:%M:%S
);
This is the 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"
mysql -uroot -pm -D $BD -Bse 'INSERT INTO `pingp22`.`checks` (
`fecha`
)
VALUES (
'date +'%Y-%m-%d %H:%M:%S''
);
'
fi
done
Any idea?
Ciao
i have the bash script below. When i execute it i get these errors:
89.17.206.129
ERROR 1102 (42000): Incorrect database name '+%Y-%m-%d %H:%M:%S
);
'
89.17.206.130
ERROR 1102 (42000): Incorrect database name '+%Y-%m-%d %H:%M:%S
);
'
89.17.206.131
ERROR 1102 (42000): Incorrect database name '+%Y-%m-%d %H:%M:%S
);
This is the 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"
mysql -uroot -pm -D $BD -Bse 'INSERT INTO `pingp22`.`checks` (
`fecha`
)
VALUES (
'date +'%Y-%m-%d %H:%M:%S''
);
'
fi
done
Any idea?
Ciao