Bug#711162: ssh-copy-id unexpected operator error
Package: openssh-client Version: 1:6.2p2-3 Severity: normal When running ssh-copy-id with or without arguments I get a shell error: /usr/bin/ssh-copy-id: 168: [: 0: unexpected operator The script continues working after this though. The offending code: [ $# == 0 ]. There is also [ $# != 1 ] in the next code block. POSIX test(1) doesn't know == and applies != only to strings. Numbers should be compared with -eq and -ne. -- System Information: Debian Release: jessie/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.8-2-amd64 (SMP w/4 CPU cores) Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages openssh-client depends on: ii adduser 3.113+nmu3 ii dpkg 1.16.10 ii libc6 2.17-3 ii libedit2 2.11-20080614-5 ii libgssapi-krb5-2 1.10.1+dfsg-5 ii libselinux1 2.1.13-2 ii libssl1.0.0 1.0.1e-3 ii passwd1:4.1.5.1-1 ii zlib1g1:1.2.8.dfsg-1 Versions of packages openssh-client recommends: ii xauth 1:1.0.7-1 Versions of packages openssh-client suggests: pn keychain none pn libpam-ssh none pn monkeysphere none ii openssh-blacklist0.4.1+nmu1 ii openssh-blacklist-extra 0.4.1+nmu1 pn ssh-askpass none -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#711162: ssh-copy-id unexpected operator error
Control: forwarded -1 https://bugzilla.mindrot.org/show_bug.cgi?id=2117 Control: tag -1 pending On Wed, Jun 05, 2013 at 12:52:06PM +0600, Andrey Rahmatullin wrote: When running ssh-copy-id with or without arguments I get a shell error: /usr/bin/ssh-copy-id: 168: [: 0: unexpected operator The script continues working after this though. The offending code: [ $# == 0 ]. There is also [ $# != 1 ] in the next code block. POSIX test(1) doesn't know == and applies != only to strings. Numbers should be compared with -eq and -ne. Actually it's fine to do equality comparisons on numbers with = and !=, just not (portably) with ==. For purposes as simple as this, numbers can be treated as strings. I have forwarded your comment upstream, and fixed the non-portability for my next upload. Thanks, -- Colin Watson [cjwat...@debian.org] -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org