rsh, strange command line parsing

Corinna Vinschen corinna-cygwin@cygwin.com
Tue May 11 08:40:00 GMT 2004


On May 11 13:21, Shun-ichi GOTO wrote:
> Hi, developers
> 
> Few days ago, I upgraded cygwin from 1.5.5 to 1.5.9
> and I found strange behavior of rsh.
> 
> The problem is that rsh want to handle argument of executing command.
> For example, 
> 
>   $ rsh host ls -a
>   rsh: unknown option -- a
>   Try `rsh --help' for more information.
>   $ rsh host "ls -a"
>   ...
>   $
> 
> I tried testing with two version of rsh contained in interutils 1.3.25
> and 1.3.28.  1.3.25 doesn't have this problem, but 1.3.28 has.

rsh is using getopt_long for option processing.  The old versions had it
statically linked in while newer versions are using the getopt_long built
into Cygwin.  By default, Cygwin's getopt_long has argument permutation
switched oon, so that explains it.  For now, add the environment variable
POSIXLY_CORRECT before calling rsh or, even simpler, quote the remote
command:

  rsh server 'ls -a'

The next version of inetutils will have argument permutation switched
off for short option processing.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Co-Project Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list