Hi
I'm somehow confused. The goal is to execute the code of ${CMD} between two cat. I'm currently stuck with this:
But this throws an error, that the Here-Document is inconsistent.
Another idea would be to use simple echo instead of expect ... but unfortunately I wasn't able to figure it out
I'm somehow confused. The goal is to execute the code of ${CMD} between two cat. I'm currently stuck with this:
Code:
CMD="$(
cat << CMDEOF | sed -E 's|[[:space:]]+| |g'
expect << EXPECT
set timeout -1
spawn openssl ocsp -index ./CA/Signing-CA/DB/Signing-CA.db \
-VAfile ./CA/Signing-CA.crt \
-CA ./CA/Signing-CA.crt \
-CApath ./CA/ \
-rsigner ./CA/Signing-CA.crt \
-rkey ./CA/Signing-CA/Private/Signing-CA.key \
-resp_key_id \
-reqin /dev/stdin \
-respout /dev/stdout -text -out ./OCSP.log
expect -re ".*phrase.*:.*"
send -- "MyPassphrase\r"
expect eof
EXPECT
CMDEOF
)"
eval "cat | ${CMD} | cat"
But this throws an error, that the Here-Document is inconsistent.
Another idea would be to use simple echo instead of expect ... but unfortunately I wasn't able to figure it out
Code:
CMD="(echo 'MyPassphrase') | openssl ocsp -index [...]"
eval "cat | ${CMD} | cat"