Shell script to name videos on device

Posted by Jordan on Stack Overflow See other posts from Stack Overflow or by Jordan
Published on 2010-03-31T18:17:10Z Indexed on 2010/03/31 18:23 UTC
Read the original article Hit count: 304

Filed under:
|
|
|
|

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?

© Stack Overflow or respective owner

Related posts about linux

Related posts about automount