How can I pass a script to an sftp connection?e.g.I make the sftp connection thus:#sftpscript.shserverIP=1.2.3.4  sftp $serverIPSo far so good.Now I have a script the looks like this:#sftpscript.sftplcd /path/to/newdircd /path/to/newdirget filename.log.*rm filename.log.*   I tried:sftp $serverIP:/path/to/sftpscript.sftpbut this just says it can't find sftpscript.sftp Is this possible? or am I going about this all wrong?
passing sftp commands to sftp connection in a file
shell script;scripting;sftp
according to man page (e.g. sftp(1) ), syntax is sftp -b /path/to/sftpscript.sftp  $serverIPhowever, I am not sure globbing option will work. (e.g. file.* )