src/com/esotericsoftware/scar/Scar.java
static public String shell (Map<? extends String, ? extends String> env, String command) throws IOException {
		List<String> matchList = new ArrayList<String>();
		Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'");
		Matcher regexMatcher = regex.matcher(command);
		while (regexMatcher.find()) {
			if (regexMatcher.group(1) != null)
				matchList.add(regexMatcher.group(1));
			else if (regexMatcher.group(2) != null)
				matchList.add(regexMatcher.group(2));
			else
				matchList.add(regexMatcher.group());
		}
		return shell(env, matchList.toArray(new String[matchList.size()]));
	}
/** Splits the specified command at spaces that are not surrounded by quotes and passes the result to
	 * {@link #shell(Map, String...)}. */
Splits the specified command at spaces that are not surrounded by quotes and passes the result to
#shell(Map, String...).
Splits the specified command at spaces that are not surrounded by quotes and passes the result to #shell ( Map String ... ) .
static public String shell (Map<? extends String, ? extends String> env, String command) throws IOException {
		List<String> matchList = new ArrayList<String>();
		Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'");
		Matcher regexMatcher = regex.matcher(command);
		while (regexMatcher.find()) {
			if (regexMatcher.group(1) != null)
				matchList.add(regexMatcher.group(1));
			else if (regexMatcher.group(2) != null)
				matchList.add(regexMatcher.group(2));
			else
				matchList.add(regexMatcher.group());
		}
		return shell(env, matchList.toArray(new String[matchList.size()]));
	}
static public String shell ( Map < ? extends String , ? extends String > env , String command ) throws IOException { List < String > matchList = new ArrayList < String > ( ) ; Pattern regex = Pattern . compile ( "[^\\s\"']+|\"([^\"]*)\"|'([^']*)'" ) ; Matcher regexMatcher = regex . matcher ( command ) ; while ( regexMatcher . find ( ) ) { if ( regexMatcher . group ( 1 ) != null ) matchList . add ( regexMatcher . group ( 1 ) ) ; else if ( regexMatcher . group ( 2 ) != null ) matchList . add ( regexMatcher . group ( 2 ) ) ; else matchList . add ( regexMatcher . group ( ) ) ; } return shell ( env , matchList . toArray ( new String [ matchList . size ( ) ] ) ) ; }
Splits the specified command at spaces that are not surrounded by quotes and passes the result to
 {@link #shell(Map, String...)}.
Splits the specified command at spaces that are not surrounded by quotes and passes the result to { @link #shell ( Map String ... ) } .