Skip to main content
22 events
when toggle format what by license comment
S Jun 7, 2023 at 4:59 history suggested JM0 CC BY-SA 4.0
Added syntax highlighting
Jun 6, 2023 at 20:34 review Suggested edits
S Jun 7, 2023 at 4:59
Dec 4, 2018 at 19:13 comment added myrdd @StéphaneChazelas FYI, I found a workaround to this SE bug, see meta.stackexchange.com/a/319440/388007. If you use it to repost your above comment, we could remove the other comments, keeping the comments section clean.. well, if you care ;)
Dec 4, 2018 at 16:02 comment added myrdd @StéphaneChazelas primarily it's a bug, see meta.stackexchange.com/q/125764/388007 — the character sequence <backtick><space> in your comment was ignored, and the next occurrence of a backtick was followed by a dot (<backtick><dot>). Since a dot is not a space (obviously…; refer to the Meta.SE question), and backtick parsing seems to be greedy, <backtick><dot> is the beginning of a code. Ugly bug. I'll comment this tho the Meta.SE question.
Dec 4, 2018 at 15:50 comment added Stéphane Chazelas @myrdd, probably my bad, I must have one too many or too few backticks in my previous comment.
Dec 4, 2018 at 15:35 comment added myrdd okay, so with cmd=(echo "foo bar"), '%q' would translate to 'echo''foo bar' (incorrect), but ' %q' translates to `` 'echo' 'foo bar'``. Thanks for clarification! (Edit: weird markdown syntax bug…)
Dec 4, 2018 at 15:18 comment added Stéphane Chazelas @myrdd, no it's not, you need either space or tab to separate arguments in a shell command line. If cmd is cmd=(echo "foo bar"), the shell command line passed to ssh should be something like ` 'echo' 'foo bar'. The *first* space (the one before echo) is superflous, but doen't harm. The other one (the ones before 'foo bar') is needed. With '%q', we'd pass a 'echo''foo bar'` command line.
Dec 4, 2018 at 14:38 comment added myrdd I'm not sure but it looks like the space in ' %q' is superfluous.
Dec 15, 2017 at 17:45 history edited Stéphane Chazelas CC BY-SA 3.0
added 290 characters in body
Dec 15, 2017 at 17:24 history edited Stéphane Chazelas CC BY-SA 3.0
added 22 characters in body
Dec 15, 2017 at 17:02 history edited Stéphane Chazelas CC BY-SA 3.0
added 113 characters in body
Oct 6, 2017 at 11:52 history edited Stéphane Chazelas CC BY-SA 3.0
deleted 4 characters in body
Apr 13, 2017 at 15:49 answer added x-yuri timeline score: 0
Apr 4, 2017 at 6:54 vote accept Stéphane Chazelas
May 26, 2015 at 21:37 comment added Otheus Sounds like a more long-lasting solution would be an rexec plugin for ssh, ala the ftp plugin.
May 26, 2015 at 19:41 comment added Stéphane Chazelas @Otheus, yes, the sh -c 'some cmd' and some cmd command lines happen to be interpreted the same in all those shells. Now what if I want to run the echo \' Bourne command line on the remote host? echo command-string | ssh ... /bin/sh is one solution I gave in my answer, but that means you can't feed data to the stdin of that remote command.
May 26, 2015 at 16:38 comment added Otheus I think you would have to do ssh host sh -c "'some cmd'" . But then you're stuck with the possibility that the remote side's shell will interpolate some cmd in a way you don't want. Is that the problem? Then what about simply running echo command-string | ssh /bin/sh?
May 25, 2015 at 20:27 history edited Stéphane Chazelas CC BY-SA 3.0
added 18 characters in body
May 25, 2015 at 20:21 comment added Stéphane Chazelas @Bananguin, no if you run ssh host sh -c 'some cmd', same as ssh host 'sh -c some cmd', that has the login shell of the remote user interpret that sh -c some cmd command line. We need to write the command in the correct syntax for that shell (and we don't know which it is) so that sh be called over there with -c and some cmd arguments.
May 25, 2015 at 20:17 answer added Stéphane Chazelas timeline score: 20
May 25, 2015 at 20:16 comment added Bananguin If the cmd argument was /bin/sh -c we would end up with a posix shell in 99% of all cases, wouldn't we? Of course escaping special characters is a bit more painful this way, but would it solve the initial problem?
May 25, 2015 at 20:11 history asked Stéphane Chazelas CC BY-SA 3.0