Posted on 08-05-2015 08:49 PM
Sorry, its late and I'm hungry...
#!/bin/sh
#
# If Pizza is less than 30 minutes old, return "YumYum".
# If Pizza is more than 30 minutes old, return "EwwYuk".
# Can use -mmin for minutes, or -mday for days.
Pizza=`find /path/to/pizza -mmin -30 -print`
YumYum="/path/to/pizza"
EwwYuk=""
if [ "$Pizza" == "$YumYum" ];
then
echo "<result>YumYum</result>"
else
echo "<result>EwwYuk</result>"
fi
<burp>
HTH,
Don
Posted on 08-06-2015 04:38 AM
@donmontalvo are you having side effects from wild fire smoke inhalation?
Posted on 08-06-2015 09:00 PM
Haha...I had to sanitize the script, so pizza was the first thing that came to mind. :)
Posted on 08-17-2015 12:22 AM
Shorter:
#!/bin/sh
if [ `find /path/to/pizza -mmin -30 -print` ]; then
echo "<result>YumYum</result>"
else
echo "<result>EwwYuk</result>"
fi