I was able to connect to the iSeries with cmd.exe but every command I tried failed.  When I thought to use PowerShell, the exact same command that failed in cmd.exe worked in PowerShell.  I don't have access to any other SSH servers so I don't know if it is iSeries specific or every SSH connection.
I will try the escaping of the ( and " tomorrow and report back.
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Kevin Adler
Sent: Friday, February 1, 2019 5:59 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: RE: Calling a program on the i via OpenSSH
   1)  ssh exists in Windows 10 but it only works with the iSeries (not sure
   about other systems) when run in PowerShell.  I could not get it to work
   with command, with or without admin.
    
   Are you saying you couldn't get ssh to work at all from cmd.exe or just
   that it couldn't connect to the IBM i server (but could connect to other
   servers)?
    
    
   2)  If there is a $ in your library or program name, the call fails.  All
   of
   my development libraries begin with a $ so I can do a backup of $*.
    
   You need to escape it or put it in single quotes:
    
   echo \$mylib
   echo '$mylib'
   echo "\$mylib"
    
   3)  It does not like the "(" when trying to specify "parms() for the
   call".
    
   Parenthesis are special characters for bourne-compattible Unix shells.
   These also need to be escaped as above.
    
   4)  I was able to pass a single parm ('system "CALL MSSUTILS/HELLOWORLD
   John"') but did not figure out how to pass multiple parms.
   5)  When passing a parm, it converted it to uppercase...in the above call,
   John became JOHN.
    
   This is standard behavior for un-quoted strings when passed to the CL
   command line (which is basically what system does). You'll need to put
   those in single quotes if you want to preserve case:
    
   "system \"CALL MSSUTILS/HELLOWORLD 'John'\""
    
   Notice that you can escape double quotes inside a double quoted string
   from bash, but single quoted strings do not allow escaping. Since CL
   strings *must* be single quotes, you have have to use double quotes for
   the outer string, with double quotes around the argument to system, and
   then single quotes for the argument to MSSUTILS/HELLOWORLD.
    
     ----- Original message -----
     From: smith5646midrange@xxxxxxxxx
     Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx>
     To: "'Midrange Systems Technical Discussion'"
     <midrange-l@xxxxxxxxxxxxxxxxxx>
     Cc:
     Subject: RE: Calling a program on the i via OpenSSH
     Date: Fri, Feb 1, 2019 4:33 PM
      
     Thanks again for all of the input.
     For anyone playing along, here are some things I have stumbled over.
      There
     may be ways around them but I didn't dig to find the answers.  If anyone
     has
     the answer, please feel free to pass it on.
     1)  ssh exists in Windows 10 but it only works with the iSeries (not
     sure
     about other systems) when run in PowerShell.  I could not get it to work
     with command, with or without admin.
     2)  If there is a $ in your library or program name, the call fails.
      All of
     my development libraries begin with a $ so I can do a backup of $*.
     3)  It does not like the "(" when trying to specify "parms() for the
     call".
     4)  I was able to pass a single parm ('system "CALL MSSUTILS/HELLOWORLD
     John"') but did not figure out how to pass multiple parms.
     5)  When passing a parm, it converted it to uppercase...in the above
     call,
     John became JOHN.
     -----Original Message-----
     From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
     John
     Yeung
     Sent: Friday, February 1, 2019 5:28 PM
     To: Midrange Systems Technical Discussion
     <midrange-l@xxxxxxxxxxxxxxxxxx>
     Subject: Re: Calling a program on the i via OpenSSH
     On Fri, Feb 1, 2019 at 3:26 PM <smith5646midrange@xxxxxxxxx> wrote:
     >
     > My end goal for this request is for a Windows server to connect to an
     > IBM I and issue the command and receive the results without any user
     > intervention via a "windows script".
     OK, great. So what is your plan on the Windows side of things? Is it
     other
     people developing the Windows script, and they are telling you that they
     want SSH?
     Or will you be responsible for the Windows script as well?
     If it's other people, do you happen to know what they are using to
     develop
     the script?
     John Y.
     --
     This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
     list
     To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
     unsubscribe, or change list options,
     visit: [1]
https://lists.midrange.com/mailman/listinfo/midrange-l
     or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
     Before posting, please take a moment to review the archives at
     [2]
https://archive.midrange.com/midrange-l.
     Please contact support@xxxxxxxxxxxx for any subscription related
     questions.
     Help support midrange.com by shopping at amazon.com with our affiliate
     link:
     [3]
https://amazon.midrange.com
     --
     This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
     list
     To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
     To subscribe, unsubscribe, or change list options,
     visit: [4]
https://lists.midrange.com/mailman/listinfo/midrange-l
     or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
     Before posting, please take a moment to review the archives
     at [5]
https://archive.midrange.com/midrange-l.
     Please contact support@xxxxxxxxxxxx for any subscription related
     questions.
     Help support midrange.com by shopping at amazon.com with our affiliate
     link: [6]
https://amazon.midrange.com
      
    
References
   Visible links
   1. 
https://lists.midrange.com/mailman/listinfo/midrange-l
   2. 
https://archive.midrange.com/midrange-l
   3. 
https://amazon.midrange.com/
   4. 
https://lists.midrange.com/mailman/listinfo/midrange-l
   5. 
https://archive.midrange.com/midrange-l
   6. 
https://amazon.midrange.com/
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: 
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at 
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: 
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.