Problem 1: Java source code files must have the same name as the class that they contain. For example, the class "GameBoard" must be in the file "GameBoard.java". Write a shell script that will go through all .java files and rename them accoring to that rule. Assume that any class definiton starts "public class" and that the only place "public class" can appear is at the beginning of a class definition, where it will be followed by the name of the class (for example, "public class GameBoard"). Use foreach to iterate over all .java files, grep to find lines that contain "public class", cut to extract the class name, and then mv to rename.
Problem 2: Write a shell script that backs up all files in the current directory by copying them to a directory whose name is the current year and month. Do not copy files if they already exist in the backup directory.