"Run Process" with arguments spanning multiple lines

I’m using the Process Library to call a utility, grpcurl. It works OK, but the lines are very long due to the -d (data) option and I am wondering if there is a way to split the command, or use line continuation ("…")

I have tried:

  • 3 dots starting at column 1 “…” immediately followed by my args
  • 3 dots starting at column 1 “…” followed by two spaces and then my args
  • Split Command Line
  • Catenate

None of them work the way I had hoped.

My goal is to take a very long line, like this:

${result}=   Run Process    grpcurl   -d   { "record" : { "f1":"valueforf1", "f2":"valueforf2", "f3": "srawlins@zebra.com", "f4": "Rawlins", "f5": "Steve", "generated_url" : "${url}"}}    -plaintext    ${service_address}:8080 svc.MyService.CreateMethod   stdout=stdout.txt   stderr=stderr.txt 

and make it more legible by spanning several lines.

But I have found this goal, which I consider to be rather simple, impossible to achieve.

An alternate form of grpcurl data ("-d") input is to supply it immediately, via standard-input, and then use:

-d @

which tells the utility that the data is coming from stdin vs the command argument itself.

I’m using the grpcurl from GitHub - fullstorydev/grpcurl: Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers

Hi Steve,

maybe try it like this:

${json}=    Set Variable    { "record" : { "f1":"valueforf1", "f2":"valueforf2", "f3": "srawlins@zebra.com", "f4": "Rawlins", "f5": "Steve", "generated_url" : "${url}"}}
${host}=    Set Variable    ${service_address}:8080
${service}=    Set Variable    svc.MyService.CreateMethod
${result}=   Run Process    grpcurl   -d   ${json}    -plaintext    ${host} ${service}   stdout=stdout.txt   stderr=stderr.txt 

There might be other ways to approach the problem, but this was the simplest I thought of. Another option which might work (i’m not 100% on this), use the collections library and append all the options to a List and pass the list to Run Process’s arguments.

Hope this helps,