scpsend

Sends a file from the host with the SCP protocol.

scpsend <filename> [<destination filename>]

Remarks

Sends the file <filename> to the host with the SCP(Secure Copy Protocol) protocol. The SSH connection is shared and the file is transferred with the Mac scp command. This command works only while connected with SSH. If the file <destination filename> is omitted, the file <filename> would be copied in the home directory of the remote host. The macro does not pause until the end of the file transfer.

Example

connect '192.168.3.2:22 /ssh /auth=password /user=hoge /passwd=fuga'
wait '$'
scpsend '/Users/user/doc/manual.pdf'
scpsend '/Users/user/doc/manual.pdf' 'tmp/foo.pdf'
; Confirm finishing a file sending.
SOURFILE = '/Users/user/doc/manual.pdf'
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