PDA

View Full Version : help with SIMPLE bash script



andyrobo60
June 24th, 2007, 05:57 PM
I am new to bash scripting and am having trouble writing a script that just runs a python script over and over in an infinite loop. So far what I have is



#!=/bin/sh
while[1] do
$HOME/python/script.py
done


This runs my script once when my python script exits I then get "bashscript.sh: 4: Syntax error: "done" unexpected" and the bash script ends.
Can someone please point out the mistake in the script

FuturePast
June 24th, 2007, 06:23 PM
Well, I can see a few mistakes there but try putting the do on a separate line.

Mr. C.
June 24th, 2007, 07:02 PM
You can keep the "do" on the same line, but need a semicolon. You can also replace the [1] test with a : as in :


#!=/bin/sh
while : ; do
$HOME/python/script.py
done

MrC

andyrobo60
June 24th, 2007, 07:19 PM
works now
thanks Mr. C.