0
I have a shell script:
#!/bin/bash
while sudo /home/pi/MyCode; do :; done
echo Error with MyCode
which runs a program in an infinite loop. I want to set up the shell script to run at start-up (which I've done with other bash scripts). However, I don't want the script to halt start-up, or prevent me from being to ssh in.
I've seen a lot of people who have had to wipe and remount their SD cards due to infinite loops be created on start-up. How do I prevent this?
I've tried augmenting the code:
#!/bin/bash
while sudo /home/pi/MyCode &; do :; done
echo Error with MyCode
to run MyCode in the background, but I keep getting an error along the lines
unexpected character before ;
Is there a way to run this script on startup without halting my startup? If so, can it be done in a way that I still have the option of SSH'ing and stopping the script at any time?
I'm not sure i understand the question. I don't have a ' before the #!. #!/bin/bash is the fist line of my bash script. – JRogerC – 2014-09-18T21:25:34.417
I made a type. I meant a
/
, which appears to be gone now anyway. – lzam – 2014-09-18T21:26:40.313