Home>

1.Write a simple java program

public class testshell {
  public static void main (string [] args) {
    int count=0;
    for (string arg:args) {
      system.out.println ("the first" + (++ count) + "parameters:" + arg);
    }
  }
}

Package the above program into centos6

Writing shell scripts

#!/bin/bash
export java_home =/usr/local/jdk1.8.0_91
export path=$java_home/bin:$path
a=`date`
java -cp /root/desktop/testshell.jar com.testshell "$a" >>/root/desktop/c.txt

Note here that the environment variable jar with java is written with the absolute path address

3. Edit the timing file (crontab -e)

*/1 * * * * /root/desktop/b.sh

to sum up

  • Previous Implementation of unit testing with Go
  • Next SqlServer AS usage