In linux, scp is used for remote file transfer, and the reverse CT technology is used. The password can be automatically entered. 1. Edit copycgi. sh. The main user filters the files to be transferred. The content is as follows :#! /Bin/bashpath = "./" if [$ #-eq 1]; then path = $1 if [! -D $ path]; then echo "please input valid dir. "exit fifi ls-al $ {path }/*. cgi | while read linedofilename = 'echo $ line | awk '{print $8 }''#! Echo "start send" $ filename. /expect_scp_one.sh $ filenameecho "send $ {filename} finish" done 2. edit the expect_scp_one.sh file, which is used to transfer a specified file to the specified machine. The content is as follows #! /Usr/bin/keep CT-f set passwd logviewset src_path [lindex $ argv 0] set dst_path "logview@172.25.38.13: /usr/local/www.AAA.com/app/mpay/ "spawn scp-Q-p $ src_path $ dst_path set timeout 30 # CT-re ". * assword: \ r "send" $ passwd \ r "set timeout 30 send" exit \ r "wrong CT eof 3. grant the executable attributes chmod + x expect_scp_one.sh chmod + x copycgi. sh 4. test. /copycgi. sh. /spawn scp-Q-p. /mp_credit_userinfo.cgi logview@172.25.38.13:/usr/local/www.AAA.com/app/mpay/logviewexitlogview@172.25.38.13's password: Encrypted ed signal 1. (no core) send. /mp_credit_userinfo.cgi finish