This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Error invoking find as a ssh command


Hi,

I cannot invoke find as command of ssh (ssh login@machine find params),
but invoking find with same params from terminal works correctly.

Maybe a bug in find utility?

Details and problem demonstration:
----------------------------------

I'm working on CentOS, connecting to Windows Server 2008 Standard 32-bit, Service Pack 2.

[root@backup domain_backup]# cat /etc/redhat-release
CentOS release 6.3 (Final)
[root@backup domain_backup]# ssh bkp@builder
Last login: Mon Dec 17 10:50:49 2012 from bdc
bkp@builder ~
$ /cygdrive/c/Windows/system32/cmd.exe /C ver
Microsoft Windows [Version 6.0.6002]
bkp@builder ~
$ logout
Connection to builder closed.
[root@backup domain_backup]#

I need to get list of files and their sizes:

[root@backup domain_backup]# ssh bkp@builder find
/cygdrive/d/Backups/Data -printf "\"%f (%s)\n\""
FIND: Invalid switch
[root@backup domain_backup]#

The problem is not in -printf parameter, because

[root@backup domain_backup]# ssh bkp@builder find /cygdrive/d/Backups/Data
FIND: Invalid switch
[root@backup domain_backup]#

works not too.
The same find invoked in terminal works:

[root@backup domain_backup]# ssh bkp@builder
Last login: Mon Dec 17 11:16:57 2012 from bdc
bkp@builder ~
$ find /cygdrive/d/Backups/Data -printf "%f (%s)\n" | head -n 2
Data (0)
BKP-builder-20120803-2359-mssql-EmpMonitor.7z (535069)
bkp@builder ~
$ logout
Connection to builder closed.
[root@backup domain_backup]#

Invoking other command in place of find works:
[root@backup domain_backup]# ssh bkp@builder ls /cygdrive/d/Backups/Data
| head -n 2
BKP-builder-20120803-2359-mssql-EmpMonitor.7z
BKP-builder-20120803-2359-mssql-EmpMonitor.7z.sha
[root@backup domain_backup]#

Invoking find on no-cygwin machine works too:
[root@backup domain_backup]# ssh root@www find /opt/backup/pool/ -printf
"\"%f (%s)\n\"" | head -n 2
pool/ (94208)
BKP-www-20121210-0033-svn-Rpt-14.tar.bz2 (2062406)
[root@backup domain_backup]#


Versions information -------------------- Cygwin.dll 1.7.17-1

find utility
find (GNU findutils) 4.5.9
Packaged by Cygwin (4.5.9-2)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Built using GNU gnulib version 1778ee9e7d0e150a37db66a0e51c1a56755aab4f
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION
FTS(FTS_CWDFD) CBO(level=2)

sshd OpenSSH_6.1p1, OpenSSL 1.0.1c 10 May 2012

Cheers,
Vlado


P.S.:
I sent this message Mon, 17 Dec 2012 11:46:56 +0100, but seems not delivered :-(


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]