X11 tricks
Kevin D. Clark
clark_k at pannaway.com
Tue Oct 26 15:00:49 EDT 2004
Stephen Adler <adler at stephenadler.com> writes:
> yup.. that was it! I'm running gnome out of the box from a Fedora Core 1
> install. My next bit of home work is to figure out where the -nolisten
> gets set...
On a related note, I present you with a couple of my favorite ksh/bash
shell aliases. In particular, I find "srcfind" and "txtfind" to be
very handy.
In your case:
txtfind /etc /usr | xargs grep '\-nolisten'
would probably yield interesting results.
Regards,
--kevin
# Author: kevin d. clark (alumni.unh.edu!kdc)
srcfind () {
if [ $# -eq 0 ] ; then
echo srcfind: please enter a directory list
else
find "${@}" \( -name \*.c \
-o -name \*.cc \
-o -name \*.h \
-o -name \*.hh \
-o -name \*.java \
-o -name \*.c++ \
-o -name \*.el \
\) -print
fi
}
writeablesrcfind () {
if [ $# -eq 0 ] ; then
echo writeablesrcfind: please enter a directory list
else
find "${@}" \( -name \*.c \
-o -name \*.cc \
-o -name \*.h \
-o -name \*.hh \
-o -name \*.java \
-o -name \*.c++ \
-o -name \*.el \
\) \
-exec test -w {} \; \
-print
fi
}
# find src files that are newer than a given timestamp file
newersrcfind () {
if [ $# -lt 2 ] ; then
echo Usage: newersrcfind file-with-timestamp directory1 directory2 ...
else
FILE=$1
shift
find "${@}" -newer $FILE \
\( -name \*.c \
-o -name \*.cc \
-o -name \*.h \
-o -name \*.hh \
-o -name \*.java \
-o -name \*.c++ \
-o -name \*.el \
\) -print
fi
}
# Finds text files in the specified directories.
# (Perl's criteria for
# this is to read the first 10% of a file and see if this mostly
# consists of printable ASCII characters)
txtfind () {
if [ $# -eq 0 ] ; then
echo txtfind: please enter a directory list
else
perl -MFile::Find -e 'find(sub{print "$File::Find::name\n" if (-f && -T);}, @ARGV);' "${@}"
fi
}
binfind () {
if [ $# -eq 0 ] ; then
echo binfind: please enter a directory list
else
perl -MFile::Find -e 'find(sub{print "$File::Find::name\n" if (-f && -B);}, @ARGV);' "${@}"
fi
}
cfind () {
if [ $# -eq 0 ] ; then
echo cfind: please enter a directory list
else
find "${@}" \( -name \*.c \
-o -name \*.cc \
-o -name \*.c++ \
\) -print
fi
}
hfind () {
if [ $# -eq 0 ] ; then
echo hfind: please enter a directory list
else
find "${@}" \( -name \*.h \
\) -print
fi
}
jfind () {
if [ $# -eq 0 ] ; then
echo jfind: please enter a directory list
else
find "${@}" \( -name \*.java \
\) -print
fi
}
elfind () {
if [ $# -eq 0 ] ; then
echo elfind: please enter a directory list
else
find "${@}" \( -name \*.el \
\) -print
fi
}
--
GnuPG ID: B280F24E
More information about the Discuss
mailing list