scpsend

Sends a file from the host with the SCP protocol. (version 4.57 or later)

scpsend <filename> [<destination filename>]

Remarks

Causes Tera Term to send the file <filename> to the host with the SCP(Secure Copy Protocol) protocol. If the file <destination filename> is omitted, the file <filename> would be copied in the home directory of the remote host. Tera Term does not pause until the end of the file transfer.

Example

connect '192.168.3.2:22 /ssh /2 /auth=password /user=hoge /passwd=fuga'
wait '$'
scpsend 'C:\usr\cvs\doc\en\teraterm.chm'
scpsend 'C:\usr\cvs\doc\en\teraterm.chm' 'tmp/foo.chm'
; Confirm finishing a file sending.
SOURFILE = 'C:\usr\ttssh2\doc\en\teraterm.chm'
DESTFILE = '~'

;; Send a file.
scpsend SOURFILE DESTFILE
;; Confirm a scp process.
do
  mpause 5000
  sprintf2 str 'ps -ef |grep -v grep |grep -c scp'
  sendln str
  waitln '0' '1'
loop while result != 1
;; Do next macro after finishing the file sending.
sendln 'echo SCP finish'
;; Exit this macro script.
end