parent
7f99e9e2f6
commit
494ea4c1bb
@ -0,0 +1,19 @@
|
||||
package com.example.sshd.test;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class SplitTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
String command = "echo hello | lscpu && uname ; whoami";
|
||||
String[] splited = StringUtils.split(command,";|&");
|
||||
System.out.println(Arrays.asList(splited));
|
||||
Assert.assertTrue(splited.length == 4);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue