Re: Difficult subdirectories check...
- From: hotmail_spam@xxxxxxxxxxx (Martin Jørgensen)
- Date: Mon, 19 Jun 2006 21:16:33 +0200
hotmail_spam@xxxxxxxxxxx (Martin Jørgensen) writes:
Hi,-snip-
./check_graphics_inclusion (bash-script-filename):
------------------------------------------------
# This finds all graphic files:
for graphics_file in $( find . \( -iname "*.png" -or -iname "*.pdf" \) ); do
# So: Which files are included and which aren't?
for texfile in $(find . -name "*.tex"); do
grep -H -i "\includegraphics" ($i);
# how to extract the filename between braces { } ?
extracted_graphicsfile = { } awk/whatever ???
# if file exists (png/pdf) and it is *not* included in .tex-file -> print it
out.
if [ graphics_file != ??texfile?? ]
echo $(graphics_file)
done
# pseudo-code included above...
Why doesn't anyone have any comments? Can't it be done with a script?
Actually my suggestion is a little wrong... The first find . \( -iname
"*.png" -or -iname "*.pdf" \) should probably store the output in a list
or perhaps even better yet: To a temporary file.
The contents of this temporary file could probably then be grep'ped and
in case a match is found in the tex-file and in case that same match
isn't found in the temperorary file, then that should be printed out.
I would say the solution isn't far away... But I'm not the expert. New
suggestion:
-----------
find . \( -iname "*.png" -or -iname "*.pdf" \) > tmp.txt
for texfile in $(find . -name "*.tex"); do
grep -H -i "\includegraphics" ($i);
# extract the filename between braces - I don't know how to do it.
# if extracted file-name is not found in tmp.txt -> print it out.
-----
Is there more to it? I don't think actually, but I may be wrong if you
say so.
Best regards
Martin Jørgensen
--
---------------------------------------------------------------------------
Home of Martin Jørgensen - http://www.martinjoergensen.dk
.
- Follow-Ups:
- Re: Difficult subdirectories check...
- From: Dave Gibson
- Re: Difficult subdirectories check...
- References:
- Difficult subdirectories check...
- From: Martin Jørgensen
- Difficult subdirectories check...
- Prev by Date: Executing dos program from cygwin
- Next by Date: Re: showing content of a list of files ?
- Previous by thread: Difficult subdirectories check...
- Next by thread: Re: Difficult subdirectories check...
- Index(es):
Relevant Pages
|