I agree with Bryan's suggestion. At least it's easier for me that way.

QSH CMD('/QOpenSys/usr/bin/sh -c "/QOpenSys/bin/script.sh"') where
/QOpenSys/bin/script.sh is any PASE shell command or script.

See IBM's article on calling shell scripts from CL.

Jacob Banda

-----Original Message-----
date: Fri, 26 Feb 2021 15:02:27 -0600
from: Bdietz400 <bdietz400@xxxxxxxxx>
subject: Re: [IBMiOSS] Scripting cURL to execute in CL Programs

It might help to put the curl steps in a shell script file and run that from
the command line program

Bryan Dietz

On Feb 26, 2021, at 9:01 AM, Michael Fulmer <mfulmer@xxxxxxx> wrote:

? Has anyone had success scripting cURL to execute in an IBM i CL

I have a project to access a Vendor Web Site using cURL to upload a
wait till the file is processed and download a resulting file.

I have been provided the cURL Commands for the process.

I've enetered cURL command through a QP2TERM Terminal Session and had
success uploading the data file.

Now I need to script the cURL Command to run from an IBM i CL Program.

The upload command is as follows:

curl -v https://vendorurl.net/import -u'Noreply@xxxxxxxxxxx:Password' -F
data=@/temp/uploaddata_20210226.csv >

I believe the problem is caused by the User Id & Password being enclosed
in single quotes.
I've written many dynamic SQL Statements in RPGLE and substituted
parameters in CL Program,
but none of my methods for quoting a string have worked.

Any advice would be appreciated.


Michael Fulmer

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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

This mailing list archive is Copyright 1997-2021 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.