Portal Home > Knowledgebase > Articles Database > pls help on simple if..then script


pls help on simple if..then script




Posted by mygethosted, 01-16-2009, 11:48 AM
hello, i would like to write a simple if..then script into shell script. echo "today date" if /etc/running.pid exist, exit this script else run /etc/work.sh exit all this will log into /etc/logging.log

Posted by ThatScriptGuy, 01-16-2009, 01:18 PM
http://www.hsrl.rutgers.edu/ug/shell_help.html

Posted by Adam-AEC, 01-16-2009, 01:25 PM
PIDFILE=/etc/running.pid date if [ -e $PIDFILE ]; then exit 0 fi /etc/work.sh exit 0

Posted by DigitalLinx, 01-16-2009, 05:20 PM
PIDFILE=/etc/running.pid date if [ -e $PIDFILE ]; then exit else /etc/work.sh fi exit

Posted by mygethosted, 01-17-2009, 03:37 AM
thanks everyone. i give it a try all of them.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Gnax vCloud Review (Views: 475)
mail on vps server? (Views: 472)