private static String escapeBashArgument(String arg) {
		if (!shellSafeChars.matcher(arg).matches()) {
			// We need to use single quoting to prevent any form of expansion.
			// But to be able to use single quotes inside the argument we need
			// to escape them with a backslash. But if we are already using
			// single quotes then we can not use escapes. To fix that we use
			// a concatenation of single quoted strings with escaped single
			// quotes in between.
			arg = arg.replaceAll("(['])", "'\\\\''");
			arg = "'" + arg + "'";
		}
		return arg;
	}
Escapes list of arguments where necessary using the way of escaping that is
appropriate for the shell we're running in
src/main/java/dev/jbang/util/CommandBuffer.java