The error occurs with Maven-SCM & continuum in my case. Maven-SCM creates following commandline:
/bin/bash -c "p4 -d /opt/continuum-1.1-beta-3-SNAPSHOT/apps/continuum/webapp/WEB-INF/working-directory/1 -cbackground-sojus-MavenSCM\opt\continuum-1.1-beta-3-SNAPSHOT\apps\continuum\webapp\WEB-INF\working-directory\1 sync"
the -c argument is created by:
Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory );
command.createArgument().setValue( "-c"+ specname );
the specname contains backslashes. The bash then removes the backslashes in specname. Ouch! That doesn't work. I think that CommandLine (or the underlying Shell) has to deal with this case. What do you think?
To test easily type:
/bin/bash -c "echo a
bc"
result: abc
Solution 1:
/bin/bash -c "echo a\\\\bc"
result: ab
c
Solution 2:
/bin/bash -c "echo 'a
bc'"
result: ab
c
To test easily type:
/bin/bash -c "echo a\bc"
result: abc
Solution 1:
/bin/bash -c "echo a\ \bc"
result: ab\c
Solution 2:
/bin/bash -c "echo 'a\bc'"
result: ab\c