@InterfaceAudience.Private
  public static String bashQuote(String arg) {
    StringBuilder buffer = new StringBuilder(arg.length() + 2);
    buffer.append('\'')
        .append(arg.replace("'", "'\\''"))
        .append('\'');
    return buffer.toString();
  }
@Test
  public void testBashQuote() {
    assertEquals("'foobar'", Shell.bashQuote("foobar"));
    assertEquals("'foo'\\''bar'", Shell.bashQuote("foo'bar"));
    assertEquals("''\\''foo'\\''bar'\\'''", Shell.bashQuote("'foo'bar'"));
  }