ssh-copy-id no newline bug

Tom G. Christensen tgc at jupiterrise.com
Wed Mar 23 09:16:38 AEDT 2016


On 22/03/16 22:32, Philip Hands wrote:
> "Tom G. Christensen" <tgc at jupiterrise.com> writes:
>
>> On 22/03/16 08:34, Philip Hands wrote:
>>>
>>>     [ "`tail -c1 .ssh/authorized_keys 2>/dev/null`" ] && echo > .ssh/authorized_keys ;
>>>
>>> anyone know of portability issues with that?
>>>
>>
>> On Solaris 10 and older /usr/bin/tail does not understand the -c1
>> syntax, it needs -1c instead.
>
> OK, it seems that tail from coreutils on Debian can deal with -1c as
> well -- odd -- is this actually the portable option despite not being in
> the manual?
>
> BTW can Solaris 10's tail handle it with a space after the c, thus:
>
>     tail -c 1
>

No. It seems the default tail in /usr/bin is the old one from the BSD 
days of SunOS 4 hence it does not know the more modern syntax.

You can see the manpage here:
https://docs.oracle.com/cd/E26502_01/html/E29030/tail-1.html

-tgc


More information about the openssh-unix-dev mailing list