lkml.org 
[lkml]   [1999]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Profanity in the Linux Kernel?!?!?
On Thu, 10 Jun 1999, Arvind Sankar wrote:
> > >> cd /usr/src/linux ; grep -i fuck `find . -name '*.[ch]'`
...
> > > find /usr/src/linux -name '*.[ch]' -exec grep -i fuck {} \;
...
> > Q> find /usr/src/linux -name '*.[ch]' -exec grep -i fuck '{}' \;
...
> While we're being pedantic, notice that the last form won't work if
> /usr/src/linux happens to be a symlink. So
>
> cd /usr/src/linux && find . -type f -a \! -name \*.o -a \! -name \*.a \
> -a \! -name vmlin\* | xargs grep -i fuck

If we want to be *really* pedantic, a couple more things are needed to get
this right:

1. Add "-print0" to the find, and "-0" to xargs, so that filenames with
funny characters won't cause problems.

2. It should be "grep -i fuck /dev/null", because it is possible that xargs
will run an instance of grep with only one argument from the find, and
then grep would not print the file name if it contained "fuck".

--Tim Smith


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.111 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site