You can place a single ; inside the block. if [ something ] ; then ; fi On Monday 31 March 2003 03:19 pm, Anders Johansson wrote:
On Monday 31 March 2003 21:56, Dylan wrote:
OK, I didn't know that, but I'm still confused as to why the detection and initialization failed.
I don't think it failed, I think it never ran at all. I suspect the script hit the faulty if-statement and exited with an error. Try this, for example
#!/bin/bash
do_beep(){ if [ "$1" = 0 ]; then echo foo fi
}
echo script starting do_beep echo script ending
If you run this script, you get the output
script starting script ending
Now try commenting out the "echo foo" line. You'll see the script doesn't output anything except an error message "unexpected token fi". I think somewhere in your boot messages, you'll see a similar error message.