0

I have a script that is generating ssl certificates for me. The screen used to work fine on my computer before and I did not change the script since I used it last time. Today I ran the script and noticed a buggy behaviour. After running the script the terminal does no longer print out characters that I type into the console. I have to close and reopen Git Bash.

I tried to find the source of the issue and finally extracted the following command:

openssl req -new -key foobar.key -out foobar.csr -config <(cat <<EOF
[req]
default_bits = 2048
EOF
)

When I run that, the following output is printed:

error on line -1 of /proc/6180/fd/63
2292:error:02001003:system library:fopen:No such process:bss_file.c:175:fopen('/proc/6180/fd/63','rb')
2292:error:2006D080:BIO routines:BIO_new_file:no such file:bss_file.c:182:
2292:error:0E078072:configuration file routines:DEF_LOAD:no such file:conf_def.c:201:

When I put the content of the heredoc into a file and pass that as a parameter to -config then the issue goes away. I cannot explain what has changed on my computer that causes this issue. How can I debug this further?

7
  • Verify that the script is in fact executed by bash. If it has a #!-line, that should contain the path to the bash executable (not sh). If you explicitly tell the shell what interpreter you use on the command line, you should use bash ./script, not sh ./script.
    – Kusalananda
    Aug 29, 2017 at 10:56
  • The script has #!/bin/bash on the first line. If I execute the above commend directly from a bash shell I get the same behaviour.
    – lanoxx
    Aug 29, 2017 at 11:09
  • After investigating this further I can confirm that the script runs just fine on a linux box, there must be some issue with the environment on windows (e.g. Git Bash, Cygwin, MSYS2, etc..). I should note that I have a separate MSYS2 install on the same computer which has the same problem. Previously I was able to execute my script in both Git Bash and MSYS2 without these problems.
    – lanoxx
    Aug 29, 2017 at 11:11
  • It has something to do with the bash you are using. The default bash in Cygwin handles process substitutions and here-documents within these without problems.
    – Kusalananda
    Aug 29, 2017 at 11:35
  • In MinGW with bash I get bash: cannot make pipe for process substitution: Function not implemented.
    – Kusalananda
    Aug 29, 2017 at 11:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.