[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to safely print a variable with secret value to stdout?
From: |
Philippe Cerfon |
Subject: |
Re: How to safely print a variable with secret value to stdout? |
Date: |
Thu, 12 May 2022 03:53:25 +0200 |
Hey Greg.
Thanks, but that doesn't quite help me or answer what I've had asked.
On Thu, May 12, 2022 at 3:25 AM Greg Wooledge <greg@wooledge.org> wrote:
> > The problem is that the code might be run on shells where this isn't
> > guaranteed
>
> You control the shell with the shebang. If you use #!/bin/bash or
> whatever shebang is appropriate to invoke bash on the target system,
> then you know you're using a builtin printf.
A user may still manually invoke
<some shell> script
And my question was specifically that it works on bash but also
portable on others.
> https://mywiki.wooledge.org/BashFAQ/069
I'm not trying to authenticate against SSH. That bash and others use
temporary files for heredocs is interesting, but not a problem in my
use case.
Regards,
Philippe.