git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] Ensure that SSH runs in non-interactive mode

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 21, 2008, 08:38 UTC
Message-ID
<m3fxq3ws16.fsf@localhost.localdomain>
In-Reply-To
<1216604693.3673.20.camel@pc7.dolda2000.com>
Fredrik Tolf <fredrik@dolda2000.com> writes:
Show 15 quoted lines
> [...] 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).

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Fredrik TolfNext: Johannes Schindelin
Message 4 of 8 in “Ensure that SSH runs in non-interactive mode”
  1. Ensure that SSH runs in non-interactive modeFredrik Tolf, Jul 21, 2008
  2. Johannes SchindelinJul 21, 2008
  3. Fredrik TolfJul 21, 2008
  4. Jakub NarebskiJul 21, 2008
  5. Johannes SchindelinJul 21, 2008
  6. Jeff KingJul 21, 2008
  7. Johannes SchindelinJul 21, 2008
  8. Fredrik TolfJul 21, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.