Displaying 1 result from an estimated 1 matches for "seen_opt_i".
2020 May 03
4
[Bug 3158] New: ssh-copy-id raises "expr: syntax error" when double-hyphen is passed ("--")
...preventative double-dash ("--"):
ssh-copy-id -i ~/.ssh/id_rsa.pub -- remote-server
will result in the following error:
expr: syntax error: unexpected argument ?[-]i?
The error is non-fatal, but it may be confusing to users.
I suspect this is caused by line 110:
[ "${SEEN_OPT_I}" ] && expr "$1" : "[-]i" >/dev/null && {
Here, "$1" is passed to expr without being validated, so if $1 is "--"
as shown in the command above, this will confuse expr. I think expr
should be called with "--" to prevent this...