#!/bin/sh
# Template
# cat /proc/asound/card[X]/codec#[Y]
# ex:
#     cat /proc/asound/card1/codec#0
#
# cat-proc-asound.sh will be auto-generated by this script

SCRIPT_PATH=/usr/bin/cat-proc-asound.sh

if [ -f $SCRIPT_PATH ]; then
    $SCRIPT_PATH
    exit 0
fi

cat << EOF > $SCRIPT_PATH
#!/bin/sh
#cat-proc-asound
EOF
chmod +x $SCRIPT_PATH

codec_path=`grep -r -e "Codec: ATI" /proc/asound/ | cut -d ":" -f 1`
for i in $codec_path;
do
    sed -i "/#cat-proc-asound/a cat $i | grep Codec:" $SCRIPT_PATH
done

$SCRIPT_PATH
