× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'm struggling with error handling with SFTP and QP2SHELL.

I created a generic shell script file that accepts parms:

#!/bin/sh
fromfile=$1
tofile=$2
user=$3
tgtsys=$4
totmpfile=$5
errlvl=$6
sftp $errlvl $user@$tgtsys << EOT
put $fromfile $totmpfile
rename $totmpfile $tofile
quit
EOT

If the put fails, it will still do the rename. And retrieving the
result out using the QUSRJOBI api always returns success.

So I am thinking that it will not work unless I execute sftp instead
of sh. I want to try that, but am wondering if I can pass parms to an
sftp file:

put $fromfile $totmpfile
rename $totmpfile $tofile

Or do I need to either have a script file for each sftp that I will
do, or create the file dynamically each time?

Just trying to understand the rules!
Thanks,

Phil

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-2024 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.