-1
我已經寫過希望ftp連接的腳本和shell腳本。您能告訴我哪個更好或更快嗎?在linux中,#!/ bin/bash和#!/ bin/expect有什麼區別?
這expect腳本
expect << EOF
spawn sftp xxx.xxx.xxx.xxx
expect "User Name :"
send "username\r"
expect "password:"
send "password\r"
expect "sftp> "
send "cd in\r"
expect "sftp> "
send "mkdir $current_date_$pharmacy_code\r"
expect "sftp> "
send "cd $current_date_$pharmacy_code\r"
expect "sftp> "
send "put $1\r"
expect "sftp> "
send "exit\r"
EOF
或
Shell腳本
sftp $host << EOF
quote USER $user
quote PASS $password
cd in
mkdir $current_date_$pharmacy_code
cd $current_date_$pharmacy_code
put $1
exit
EOF
Git有一個很酷的bash shell用於windows。像命令窗口運行,但有Linux命令。 – 2015-02-23 04:44:51
除了可以在MS Windows上使用(通過git和cygwin),bash也常用於Mac OSX。 – John1024 2015-02-23 05:13:04