#!/bin/bash

# rpm -q --quiet task-texlive-full-doc
# [ $? -ne 0 ] && \
#     echo "Usage: $(basename $0) > result.txt" && \
#     echo "please install task-texlive-full-doc" && \
#     exit 1

(
    cd /usr/bin
    for lnk in $(rpm -ql texlive | grep /usr/bin); do
	[ -L $lnk ] || continue
	rlnk=$(readlink $lnk | sed -e "s|../|/usr/|")
	#echo "$(rpm -qf $rlnk),$lnk,$rlnk,$(head -n 1 $lnk)"
	echo "$(rpm -qf --qf '%{name}' $rlnk),$lnk,$rlnk"
    done
) | sort | egrep -v "^texlive,"

exit
