Skip to content

Instantly share code, notes, and snippets.

@dietmarw
Created February 23, 2012 14:37
Show Gist options
  • Save dietmarw/1893117 to your computer and use it in GitHub Desktop.
Save dietmarw/1893117 to your computer and use it in GitHub Desktop.
#!/bin/bash
OMLIBRARY="/tmp/MSLrelease/Modelica_aster/Modelica aster/Resources/help/"
cd "$OMLIBRARY"
rm -f *.png *.pdf FindFiles.log
grep -v http:// *.html | grep -v [Mm][Oo][Dd][Ee][Ll][Ii][Cc][Aa]:// | egrep -o "[A-Za-z_0-9%.: -]*/[A-Za-z_0-9%.:/ -]*\.(png|jpg|pdf)" | cut -d: -f2- | sort -u | tr -d \" > tmp
for f in `cat tmp`; do
f=`echo $f | sed 's/%20/ /'`
if test -f "$OMLIBRARY/$f"; then
## This one will be needed/adjusted for standalone documentation
`echo $f`
# d=`dirname "$f"`
# mkdir -p "$d"
# cp "$OMLIBRARY/$f" "$f"
else
echo Not found: $f | tee -a FindFiles.log
fi
done
#rm -f tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment