How to process output and send \n afterwards in Bash?

65 views Asked by At

I am using the following tool: https://github.com/EnigmaBridge/certbot-external-auth#json-mode

The tool returns a JSON object and waits for \n before it continues.

What I would like to achieve is this:

  1. Grab the first JSON object JSONOUTPUT1=$(certbot ...)
  2. Process the JSON output
  3. Send the \n input to the certbot command in JSONOUPUT1 (see point 1)
  4. Collect the next JSON object in JSONOUTPUT2

I'm not sure where to start to achieve this, any help is welcome.

1

There are 1 answers

1
Matt On

I am guessing you want an '\n' right after your certbot terminates:

JSONOUTPUT1=$(certbot ... && echo)