0
我想要一個shell腳本(ubuntu),它可以逐行讀取sql表中的數據! 我想訪問EACH行,例如,用簡單的if語句來檢查,你知道嗎?Unix Shell腳本:閱讀和使用MySQL行逐行
#!/bin/bash
TIME=`date +"%T"`
echo true > log/ausgefuehrt-$TIME.log
/opt/lampp/lampp start
echo $TIME
#ASSIGNING MYSQL
MYSQL=/opt/lampp/bin/mysql
#$MYSQL -e"select * from ftp.ftp" -u root
$MYSQL -e"select * from ftp.ftp"
#STARTING TO FETCH EACH ROW (trying)
WHILE read ROW ;
do echo $ROW # HERE <<< is the problem.. i dont know how to access each row :/
done
exit
非常感謝你;-) –