You should work on the presumption that if the file name ends ,v
, it is an RCS file. Any interlopers that are not should be few and far between.
find $HOME -name '*,v'
If you are consistent about using an RCS sub-directory, then you can use the POSIX find
option -path
to track down files in RCS sub-directories with:
find $HOME -path '*/RCS/*,v'
If you must identify actual RCS files, then you'll need to run some program (script) to validate that the files really are RCS files:
find $HOME -name '*,v' -exec rcsfiles {} +
where rcsfiles
is a hypothetical script that echos the names of the arguments it is given that actually are RCS files. I would use the rlog
command to identify whether the file is an RCS file or not. The rcs
command doesn't have a no-op operation that will validate an RCS file. The rcsfiles
script might well be as simple as:
for file in "$@"
do
if rlog "$file" >/dev/null 2>&1
then echo "$file"
fi
done