echo "INSERT INTO 'pastebin'.'pastes' ('title', 'name', 'raw') VALUES ('Gigafun Compile Log', 'Dway', 'LOAD_FILE('ggf_compile.log')');" | mysql -u trinity --password=trinity pastebin
takto to taktéž nejde
output:
root@dway: [/home/wow/scr/comp]# bash ggf.sh
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 ''pastebin'.'pastes' ('title', 'name', 'raw') VALUES ('Gigafun Compile Log', 'Dwa' at line 1
root@dway: [/home/wow/scr/comp]#
/e: tak jsem se pokusil script trošku změnit, no vše funguje, až na to, že do sloupce 'raw' nelze zapsat obsah souboru ggf_compile.log
script:
#!/bin/bash
function compile()
{
cd /home/wow/srv/ggf
mkdir -p build
cd build
cmake /home/wow/srv/ggf/ -DPREFIX=/home/wow/srv/ggf/build/ -DLIBSDIR=/home/wow/libs/
make -j8
make install
}
function compile_to_file()
{
compile | tee ggf_compile.log
}
function compile_log_to_paste()
{
echo "INSERT INTO pastebin.pastes (title, name, raw) VALUES ('Gigafun_Compile_Log', 'Dway', 'LOAD_FILE('ggf_compile.log')'');" | mysql -u trinity --password=trinity pastebin
}
#compile_to_file
compile_log_to_paste
output:
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 'ggf_compile.log')'')' at line 1