#!/bin/sh if [ -z "$1" ]; then echo "Finds all folders named DONOTSCAN and creates a .nomedia file in them" echo "and in every directory in the structures under them." echo "" echo "USAGE: $0 " echo "" exit 0 fi find $1 -type d -name "DONOTSCAN"|while read TITLE do echo "##############################################" find "$TITLE" -type d|while read DIRECTORY do echo "Creating .nomedia file for $DIRECTORY" touch "${DIRECTORY}/.nomedia" chown nobody:users "${DIRECTORY}/.nomedia" done done