This is the mail archive of the cygwin@cygwin.com 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]

RE: Broken since 1.3.10, or earlier


Another off-topic find/grep idea:

$ find . -name '*.java' -print0 | xargs -0 grep 'Copyright' /dev/null

The find -print0 goes with the xargs -0 option to use NUL-terminated strings.
The /dev/null is included in grep to force the name to print.
(Grep prints the name if there's more than one file input.)

A sample of the output might look like this:
glut-3.7.3/progs/advanced/shadowfun.c:/* Copyright (c) Mark J. Kilgard, 1997.
*/
glut-3.7.3/progs/advanced/texwinalign.c:/* Copyright (c) Mark J. Kilgard, 1998.
*/
glut-3.7.3/progs/advanced/videoresize.c:/* Copyright (c) Mark J. Kilgard, 1996.
*/

Is that any help?
>
> I know that one, but it doesn't give me the file path. My idea behind the
> syntax is that I have a bit more flexibility to do some other stuff, since I
> know both the line and the path to the file. Of course, if I didn't need to
> worry about spaces in pathnames, I'd just use a for loop.
>
> But forget about the syntax for a moment. The real issue here is what *bash*
> is doing.
Well, I can't help there.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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