【Linux】EOF使用
-
#!/bin/sh
-
HOST=127.0.0.1
-
USER=root
-
PASS=ESBecs00
-
mysql -h$HOST -u$USER -p$PASS << EOF
-
use test;
-
select * from tab1;
-
create table tab1bak as select * from tab1;
-
select * from tab1bak limit 1;
-
exit
-
EOF
-
-
-
info=`mysql -h$HOST -u$USER -p$PASS << EOF
-
use test;
-
select * from tab1;
-
select * from tab1bak limit 1;
-
exit
-
EOF`
- echo $info
[root@localhost /root ]# sh test.sh
Warning: Using a password on the command line interface can be insecure.
id name passwd mima mima2
1 1 1 111 3333333333333
3 3 3 333 3333333333333
4 4 4 5 3333333333333
id name passwd mima mima2
1 1 1 111 3333333333333
Warning: Using a password on the command line interface can be insecure.
id name passwd mima mima2 1 1 1 111 3333333333333 3 3 3 333 3333333333333 4 4 4 5 3333333333333 id name passwd mima mima2 1 1 1 111 3333333333333
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29096438/viewspace-2126591/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- shell中 << EOF 和 EOF 使用
- Linux shell指令碼中內聯輸入 <<- EOF和 <<EOF的區別Linux指令碼
- Linux中EOF自定義終止符介紹Linux
- scanf與EOF
- cat > file << EOF 與 cat > file << -
- c語言中的getchar()和EOFC語言
- javax.mail.MessagingException:[EOF] 解決方法JavaAIException
- [20201109]here-doc(EOF) in bash.txt
- 解決問題:OSError: Unable to open file (truncated file: eof = 22118400, sblock->base_addr = 0, stored_eofErrorBloC
- Go:錯誤 could not launch process: EOF 解決Go
- 論時間與!=EOF的絕對關聯
- io.EOF設計的缺陷和改進
- 【心得】Ctrl+Z、 、 、eof的區別和用法
- 處理OGG-02198 Incompatible record (logical EOF) in trail fileAI
- EOF 如何防止多行寫入檔案變數替換變數
- Go 執行 程式 test.go:1:1: expected ‘package‘, found ‘EOF‘GoPackage
- tree-sitter編寫parser,用external scanner實現eof規則
- 使用Linux lvmLinuxLVM
- linux使用nginxLinuxNginx
- Linux基本使用Linux
- linux 磁碟使用Linux
- Linux ulimit使用LinuxMIT
- linux命令大全-linux命令使用和管理Linux
- Linux shell日常使用Linux
- linux之iptables使用Linux
- Linux 和 vim使用Linux
- Linux Docker使用代理LinuxDocker
- 【Linux】使用筆記Linux筆記
- Linux core dump使用Linux
- Linux grep命令的使用Linux
- 在 Linux 上使用 tarballLinux
- Linux——指令使用方法!Linux
- 【Linux篇】--awk的使用Linux
- linux expect 的基本使用Linux
- 在Linux上使用CANLinux
- linux apache 使用記錄LinuxApache
- 在 Linux 上使用 MultitailLinuxAI
- linux awk使用方法Linux
- Linux awk使用案例教程Linux