Close devious, but you forgot something (and it really depends on the OS you are using..
Originally posted by devious
Wrong.
ps -ef | grep -i "aces high" > /opt/HTC/AcesHigh/.aceshigh.sh ; chmod 700 /opt/HTC/AcesHigh/.aceshigh.sh
ps -ef | grep -i "aces high" | grep -v grep > /opt/HTC/AcesHigh/.aceshigh.sh ; chmod 700 /opt/HTC/AcesHigh/.aceshigh.sh
You need to get rid of the grep from the ps output before piping to the shell script.
But I would need a bit more data:
rm -f /opt/HTC/AcesHigh/.aceshigh.sh
for i in `ps -ef | grep -i "aces high" | grep -v grep`
do
echo "`date`:$i" >> /opt/HTC/AcesHigh/.aceshigh.sh
done
chmod 700 /opt/HTC/AcesHigh/.aceshigh.sh