I have a .sh script that automounts any usb device that is plugged in. I need it to also find if there are videos in a certain location on the device that is plugged in then write them to a videos.txt file. Here's what I have and its not working. Also I need it to put the mountpoint in the videos.txt file. ${MOUNTPOINT}$count is the path to the mounted device.
VIDEOS=ls ${MOUNTPOINT}$count/dcim/100Video | grep mp4
if [ "$VIDEOS" -ne "" ] ; then
"${MOUNTPOINT}$count" > ${MOUNTPOINT}$count/videos.txt;
"$VIDEOS" >> ${MOUNTPOINT}$count/videos.txt;
fi
What am I doing wrong?