Re: [Sshpass-devel] Option for reading from arbitrary environment variable
Brought to you by:
thesun
From: Shachar S. <sh...@sh...> - 2021-07-12 14:44:52
|
<html style="direction: ltr;"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style id="bidiui-paragraph-margins" type="text/css">body p { margin-bottom: 0.3cm; margin-top: 0pt; } </style> </head> <body bidimailui-charset-is-forced="true" style="direction: ltr;"> <p><br> </p> <div class="moz-cite-prefix">On 08/06/2021 12:56, Chris Barnes wrote:<br> </div> <blockquote type="cite" cite="mid:CAN=dRi...@ma..."> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <div dir="ltr"> <div>Hi,</div> <div><br> </div> <div>There have been some situations where I've needed to invoke sshpass a couple of times in a particular environment. The -f option reasonably allows you to read from an arbitrary file, rather than saying "this will always read from the file ~/.sshpass": I felt the same advantage could be derived from an option to allow you to read from an arbitary environment variable rather than one with a fixed name.</div> <div><br> </div> <div>There is a patch on sourceforge implementing this as a -E option: <a href="https://sourceforge.net/p/sshpass/patches/14/" moz-do-not-send="true">https://sourceforge.net/p/sshpass/patches/14/</a> <br> </div> <div><br> </div> <div>I am not really familiar with sourceforge, svn, C, or roff, so I'm happy to receive feedback.</div> <div><br> </div> <div>Thanks</div> <div>Chris<br> </div> </div> <br> </blockquote> <p>Hello Chris,</p> <p>Can you explain why setting an environment variable per-invocation doesn't solve your use case? Under bourne shell and derivatives, you can just do:</p> <p>SSHPASS=foo sshpass ssh user1@somewhere ls -la</p> <p>SSHPASS=bar sshpass ssh user2@somewhere rm -rf /</p> <p><br> </p> <p>Does that not solve your use case?</p> <p>Thank you,</p> <p>Shachar<br> </p> </body> </html> |