Scripts to mirror 3GPP specs in PDF format and symlink useful names
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
959 B

# a rather simple script to recover the 3GPP spec number (if any) from the
# title page of the ETSI TS PDF and then create a symlink in the format
# Author: Harald Welte <>
# source base directory containing the ETSI TS PDFs
# directory from where to create all the symlinks
# ensure the symlink directory exists
[ -d $LINKDIR ] || mkdir $LINKDIR
# get a list of all pdf files
PDFS=`find $SRCDIR -name "*.pdf"`
for f in $PDFS; do
# check if it contains a line with suitable prefix
RES=`pdfgrep -m 1 '\(3GPP TS' $f`
if [ $? -eq 0 ]; then
# extract the filename with spec number + version name (e.g. 44.008-4.0.0.pdf)
LINK=`echo $RES | awk '/\(3GPP TS ([0-9]+\.[0-9]+) version (\w+)/ {printf "%s-%s.pdf", $3, $5}'`
if [ "x$LINK" != "x" ]; then
echo $LINK
# crate the actual symlink
ln -sf ../$f "$LINKDIR/$LINK"