I'd make the 'for f in" a function:
Code:
dir1=~/tmp/dir1 ;<-- this may not work, try absolute /path/to/tmp/dir1
dir2=~/tmp/dir2 ;<-- this may not work, try absolute /path/to/tmp/dir2
function do_work ()
{
for f in *.avi *.mp4; do
case $f in
*[Tt][Ee][Ss][Tt]*) mv -n $f $dir1 ;;
*[Ff][Ii][Ll][Ee]*) mv -n $f $dir2 ;;
esac
done
}
then 'touch' a /tmp file and call the function, then remove the /tmp file as in
Code:
touch /tmp/$$
( ( echo 1 ; while [ -f /tmp/$$ ] ; do sleep 1 ; done ; echo 100 ) | yad --progress --pulsate --auto-close --text="Doing Work..." --width=150 --title="" --undecorated --no-buttons) & do_work
rm /tmp/$$
See http://bournetoraiseshell.com/articl...11070711554993 for my similar script.
I haven't been able to have the progress bar work in this kinds of activity, so I used pulsate to indicate activity.
Hope that helps.
Bookmarks