2012-01-27 41 views
0

我怎樣才能使一個bash腳本這是我的命令是:如何使一個bash腳本

mysql -h(sample) -u(sample) -p -e "insert into databasename.tablename select count(*)from information_schema.processlist;" 

肅然,

喬伊

+1

所以,你要的是什麼做腳本來做? – 2012-01-27 02:05:59

+0

'touch script.sh' ;-) – ceejayoz 2012-01-27 02:06:34

+0

邏輯是我想要將這個information_schema.processlist的數據插入到另一個mysql服務器 – 2012-01-27 02:11:04

回答

1
-bash-4.2$ cat > my_bash_script << "EOF" 
> #!/bin/bash 
> 
> mysql -h(sample) -u(sample) -p -e "insert into databasename.tablename select count(*)from information_schema.processlist;" 
> EOF 
-bash-4.2$ chmod 755 my_bash_script