groovy syntax for executing unix command with process output
问题 I'm trying to execute a shell command in groovy. The command is diff <(ls dir1) <(ls dir2) . From the shell, that works fine, but when I do "diff <(ls dir1) <(ls dir2)".execute() in groovy, I get a shell error saying diff: extra operand . I can't seem to figure out the correct syntax for this in groovy. Can someone point out what I'm doing wrong? 回答1: If you can live with calling this via bash like you do on command line, then the syntax to call by shell is: def p = ["/bin/bash", "-c", "diff