public boolean executeLocalQuery(String keyRegExp, String valRegExp, String unitTestName)
	{
		System.out.println("Executing local query for unit test cast : " + unitTestName);
		ProcessBuilder pb = null;
		try
		{
			String outputFileName = "unit_tests/" + unitTestName + "/output_local.txt";
			File testFile = new File(outputFileName);
			if(testFile.exists())
				testFile.delete();
				
			for(int i=1; i<4; i++)
			{
				List<String> commands = new ArrayList<String>();
	            commands.add("/bin/sh");
	            commands.add("-c");
				if(keyRegExp != "" && valRegExp != "")
					commands.add("grep -E '(" + keyRegExp + ".*:.*" + valRegExp + ")' machine." + i + ".log");
				else if(keyRegExp != "")
					commands.add("grep -E '(" + keyRegExp + ".*:)' machine." + i + ".log");
				else if(valRegExp != "")
					commands.add("grep -E '(:.*" + valRegExp + ")' /machine." + i + ".log");
				pb = new ProcessBuilder(commands);
				//pb.redirectOutput(Redirect.appendTo(new File("unit_tests/" + unitTestName + "/output_local.txt")));
				Process ps = pb.start();
				BufferedReader is = new BufferedReader(new InputStreamReader(ps.getInputStream()));
				BufferedWriter os = new BufferedWriter(new FileWriter(outputFileName, true));
				String line;
				while ((line = is.readLine()) != null) 
				{
				    os.write(line + "\n");
				}
				ps.waitFor();
				is.close();
				os.close();
			}
			List<String> commands = new ArrayList<String>();
            commands.add("/bin/sh");
            commands.add("-c");
            commands.add("sort unit_tests/" + unitTestName + "/output_local.txt");
            pb = new ProcessBuilder(commands);
            //pb.redirectOutput(new File("unit_tests/" + unitTestName + "/output_local_clean.txt"));
            Process ps = pb.start();
			BufferedReader is = new BufferedReader(new InputStreamReader(ps.getInputStream()));
			BufferedWriter os = new BufferedWriter(new FileWriter("unit_tests/" + unitTestName + "/output_local_clean.txt"));
			String line;
			while ((line = is.readLine()) != null) 
			{
			    os.write(line + "\n");
			}
			ps.waitFor();
			is.close();
			os.close();
			return true;
		}
		catch(Exception e)
		{
			System.out.println("ERROR : Exeception executing local query for : " + unitTestName);
			return false;
		}
	}