I would like Apache Commons-exec to run:
git status | head -n1 | cut -c13-
However seems it can not execute the command line and give error, Any ideas?
CommandLine cmdLine = CommandLine.parse( "git status | head -n1 | cut -c13-" );
DefaultExecutor executor = new DefaultExecutor();
executor.setWorkingDirectory( file );
executor.execute( cmdLine );
Error:
error: unknown switch `n'
usage: git status [options] [--] <filepattern>...