I have a script below that goes to the given directory and plays the newest powerpoint presentation via powerpoint viewer and wine.
So far it works perfectly but now Id like to add a while statement to essentially run
find /ticker/powerpointshare -mmin -1 -type f -iname "*.ppt"
and if it finds a file then execute the top half of my script again.
#! /bin/sh
# Start the newest Powerpoint presentation
# Change Directory to /ticker/powerpointshare
cd /ticker/powerpointshare
# Creates the variable newppt for use in this script
# ls -tr sorts the the ls output and pipes in into tail to grab the newest file
newppt=$(ls -tr | tail -1)
echo This is the newest powerpoint presentation
echo $newppt
cd /ticker/powerpointshare
# We use wine to open the powerpoint presentation with Powerpoint Viewer 2007
wine "C:\Program Files\Microsoft Office\Office12\PPTVIEW.EXE" /N $newppt
exit
I was thinking of killing the process if it finds something and regarding the powerpoint its meant to play in a loop until it finds a new powerpoint presentation
The same reason lots of things don't run in crontab according to our FAQ, a much more minimal environment than you get from a login. Try setting PATH to a more complete value yourself, or sourcing /etc/profile
By PATH I mean the PATH variable, though the full path could also work.
Have you tried either of these?
It could also be that, without a proper login, it just can't access your X11 server. That may be required and would make sense; how is it supposed to work when your GUI isn't logged in, for instance?
I'm not convinced launching a process which uses X even makes sense until you've already logged into X. It ought to be launched by a process created by X, as well. Perhaps you could put /path/to/script.sh & in your ~/.xinitrc