0

This script

#!/bin/sh
once=true

while $once do
stop & PID=$!
sleep 10M

if [$!=0]; then
start
break
else
kill $PID
fi

done

Gives

./restart.sh: line 18: syntax error near unexpected token `done'
./restart.sh: line 18: `done'

I don't understand, it had run previously on another unix system. Am i missing something?

EDIT

stop and start are functions that simply run stop.sh and start.sh respectively.

1 Answer 1

4

You seem to be missing a semicolon on line 4. Modifying it to read

while ${once}; do

should fix it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.