I'm porting a Java program involving ProcessBuilder and batch files from Windows to Mac, and the Windows-specific app has the following code.
The batch file is as follows:
@echo off
setlocal
start /wait java BatchWakeMeUpSomehow
if errorlevel 1 goto retry
echo Finished successfully
exit
:retry
echo retrying...
start /wait java BatchWakeMeUpSomehow
And this is the Java code :
public class WakeMeUpSomehow {
static class Message extends Thread {
public void run() {
try {
while(true)
{
System.out.println("Hello World from run");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
try {
Runtime.getRuntime().addShutdownHook(new Message());
while(true)
{
System.out.println("Hello World");
Thread.sleep(100);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
What i need is - how do you create a similar batch file on Mac OS ( which is linux- based ) . I understand that there aren't batch files on Mac's.
Thanks very much for any assistance.