Re: [PATCH v2] Ensure that SSH runs in non-interactive mode
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 21, 2008, 10:56 UTC
- Message-ID
- <alpine.DEB.1.00.0807211255010.3305@eeepc-johanness>
- In-Reply-To
- <m3fxq3ws16.fsf@localhost.localdomain>
Hi,
On Mon, 21 Jul 2008, Jakub Narebski wrote:
Show 30 quoted lines
> Fredrik Tolf <fredrik@dolda2000.com> writes:
>
> > [...] Here's some makeshift documentation:
> >
> > The string specified in core.sshcommand is first checked if it matches
> > any of the built-in templates, in which case it is expanded (I've added
> > the templates "openssh" and "plink" by default). When used, the string
> > is split into words, each of which is processed as follows:
> >
> > * If a word is %p, it is replaced by the port number, if specified.
> > If the port number is not specified, the word is deleted.
> > * If a word is %h, it is replaced by the remote host name.
> > * If a word begins with %P, it is deleted if no port number is
> > specified. This is to allow for specifying different port number
> > flags for different SSH implementations. The syntax is a bit ugly,
> > but I cannot really think of anything that would look better.
> > If a port number has been specified, the leading %P is simply deleted.
>
> There is a syntax which would look better, but perhaps it is a bit
> overkill in this situation. Namely use either shell conditional
> expansion:
>
> ${p:+-P $p}
>
> or syntax used in RPM spec macros
>
> %{?p:-P %p}
>
> (and there is complementing %{!?<var>:<expansion>} in RPM spec macro
> language).Yes, this is overkill. I would even have passed the port argument _always_, since the port 22 for ssh is as likely to change as hell will not freeze over. Actually, I am not so sure about the latter.
Ciao, Dscho