I need to run a command containing '<' in it.
I can run it from the command line, but it throws an error when I put it in mvn exec.
Team:
c:\apps\putty\plink.exe [email protected] -T -ssh -2 $SHELL /dev/stdin 'a b c d' < test.sh
test.sh:
#!/bin/bash
echo "execution parameters: [email protected]"
Command line output:
runtime options: abcd
pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<id>test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration><executable>c:\apps\putty\plink.exe</executable>
<commandlineArgs>"[email protected] -T -ssh -2 $SHELL /dev/stdin 'a b c d' < test.sh"</commandlineArgs>
</configuration>
</execution>
</executions>
</plugin>
I tried changing '<' to '& lt;' by putting commandlineArgs in CDATA, putting doubleqoutes (") everywhere, but couldn't make it work.
[DEBUG] Executing command line: [c:\apps\putty\plink.exe, > [email protected] -T -ssh -2 -pw tomcat $SHELL /dev/stdin 'a b c d' < test.sh]
Unable to open connection: Host does not exist[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
or
[DEBUG] Executing command line: [c:\apps\putty\plink.exe, [email protected], -T, -ssh, -2, -pw, tomcat, $SHELL /dev /stdin 'a b c d' < test.sh]
bash: test.sh: No such file or directory [INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
I suspect the '<' parameter, but I'm not sure what the problem is.
Any tips?
UPDATE: ", '<' to '& lt;', commandlineArgs CDATA, doubleqoutes (" ) , ." - !