3

I'm writing an install script including generating a Diffie Hellman file with the command

openssl dhparam -out /tmp/dhparam.pem 2048

As it can take some time and it isn't required for the following steps, I was thinking to make it run in the background but I can't find a way to make it run quietly, it keeps logging in the terminal where the script is running. Here are some failed attempts:

openssl dhparam -out /tmp/dhparam.pem 2048 > /dev/null &
openssl dhparam -out /tmp/dhparam.pem -quiet 2048 &

It doesn't seem to be writing to stdout, (but rather directly on /dev/tty ?) so I'm out of idea on how to make it quiet: any clue?

5

Are you certain the command is not writing output to stderr? Does the following command run silently as you're expecting?

openssl dhparam -out /tmp/dhparam.pem 2048 &>/dev/null
| improve this answer | |
  • that's it! but what would be the reason to output to stderr? oO – maxlath Sep 29 '16 at 9:05
  • oh, I think I found why: if no output is specified (-out), it outputs to stdout, which should then not be polluted by all the "." and "+": $ openssl dhparam 2048 2> /dev/null. That kind of make sense – maxlath Sep 29 '16 at 9:12
  • 1
    @maxlath - "... what would be the reason to output to stderr" - Lack of consistency and quality control. – jww Oct 12 '16 at 16:26
  • 1
    @jww incorrect. stderr is the proper place for non standard output like debug information. – Andy Feb 16 '18 at 9:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.