×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Hi again All

I've made good progress, but want now to go to the next level and use a
parameterized script to specify the from/to directory and the file name. I
have done a similar thing successfully in the past with FTP, but sFTP
obviously has some differences.

The weird thing is that every line that's in the script works if I
cut/paste it in to a QP2TERM session, but the script still fails. Here is
the manually keyed session (with minor obfuscation):

sftp 20.12.34.567

Welcome to Some1 SFTPConnected to 20.12.34.567 .
sftp>

cd /Prod/toSome1/SKU

sftp>

lcd /usr/local/files/some1/SKU/

sftp>

put APCPARTSCV202406050040.csv

Uploading APCPARTSCV202406050040.csv to
/Prod/toSome1/SKU/APCPARTSCV202406050040.csv
sftp>

# DO NOT EDIT THIS SCRIPT ***

sftp>

# Generated with QSHELL script /usr/local/bin/Some1Dail2

sftp>



Here's the script Some1Dail3.sftp itself; you can see it's the same thing:

cd /Prod/toSome1/SKU
lcd /usr/local/files/some1/SKU/
put APCPARTSCV202406050040.csv
# DO NOT EDIT THIS SCRIPT ***
# Generated with QSHELL script /usr/local/bin/Some1Dail2


Here's how I ran it:

sftp -b /usr/local/bin/Some1Dail3.sftp 20.12.34.567


But I get this result:

sftp -b /usr/local/bin/Some1Dail3.sftp 20.12.34.567

Welcome to Some1 SFTPInvalid command.

sftp> \203\204@a
\327\231\226\204a\243\226\322\205\231\231\250a\342\322\344%\223\203\204@a
\244\242\231a\223\226\203\201\223a\206\2
11\223\205\242a\222\205\231\231\250a\342\322\344a%\227\244\243@
\301\327\303\327\301\331\343\342\303\345\362\360\362\364\360\366\3
60\365\360\360\364\360K\203\242\245%{@\304\326@\325\326\343@
\305\304\311\343@\343\310\311\342@\342\303\331\311\327\343@\311\325@\
342\305\344@\\\%{@\307\205\225\205\231\201\243\205\204@\246\211\243\210@
\330\342\310\305\323\323@\242\203\231\211\227\243@a\244\2

42\231a\223\226\203\201\223a\202\211\225a\322\205\231\231\250\304\201\211\223\362%

Connection to 20.12.34.567 closed by remote host.

$



What am I doing wrong? A simpler script works with the only difference
being it PUTs a full path/file name instead of separating it into an LCD
and a PUT file_name.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.