private static String parseFilesAndCompare(ArrayList<String> logFilenames, ArrayList<String> greppedFilenames, String command, String[] hosts) {
		boolean isMatch = true;
		String result = "";
		String tempCommand = command;
		
		//get the grepped results from each server and compare to local grep results
        for(int i=0;i<hosts.length;i++) {
            ArrayList<String> localGrepResults = new ArrayList<String>();
            ArrayList<String> remoteGrepResults = new ArrayList<String>();
            
			//do a local grep on logFilenames and compare lineNumbers
        	command = tempCommand + logFilenames.get(i);
			try {
				Process p = Runtime.getRuntime().exec(new String[] {"/bin/sh", "-c", command});
		        BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream())); 
		        String s = "";
		        
		        // read the output from the command
	        	//get the line number for exact comparison
		        while ((s = stdInput.readLine()) != null) {
		        	localGrepResults.add(s.split("#LINE_NUMBER#")[1]);
		        }
		        stdInput.close();
		        
		        //get all the line numbers for the same server (the remote page)
		        BufferedReader br = new BufferedReader(new FileReader(greppedFilenames.get(i)));
		        String line;
		        while ((line = br.readLine()) != null) {
		        	remoteGrepResults.add(line.split("#LINE_NUMBER#")[1]);
		        }
		        br.close();
		        
		        //sort results for comparison
		        Collections.sort(remoteGrepResults);
		        Collections.sort(localGrepResults);
		        
		        //compare each element
		        for(int j=0;j<Math.min(remoteGrepResults.size(), localGrepResults.size());j++) {
		        	if(!remoteGrepResults.get(j).equals(localGrepResults.get(j))) {
		        		isMatch = false;		
		        		result = "FAIL**Test Failed Matching Elements From The Remote grep And Local grep**FAIL";
		        	}
		        }
		        
		        //fail if they are not the same size
		        if(remoteGrepResults.size()!=localGrepResults.size()) {
		        	isMatch = false;		
        			result = "FAIL**Results inconclusive.  Number of Results Do Not Match**FAIL";
		        }
		        
		        //break immediately 
		        if(!isMatch)
		        	break;
		        
			} catch (IOException e) {
				System.out.println("Exception thrown getting reply from server.");
			} 
        
        }
        
        //if all files match then mission successful
		if(isMatch)
			result = "SUCCESS**Local and Remote Greps Match!**SUCCESS";
        return result;
	}