0

I have a command like this

bash -c 'cd \"/Users/Shammon/Projects/t2i-tokenisation-corda/build/nodes/AGCSIT\" ; \"/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/bin/java\" \"-Dcapsule.jvm.args=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5008 -javaagent:drivers/jolokia-jvm-1.6.0-agent.jar=port=7008,logHandlerClass=net.corda.node.JolokiaSlf4jAdapter\" \"-Dname=AGCSIT\" \"-jar\" \"/Users/Shammon/Projects/t2i-tokenisation-corda/build/nodes/AGCSIT/corda.jar\" && exit'

When I run this in match terminal, I am getting the following error

bash: line 0: cd: "/Users/Shammon/Projects/t2i-tokenisation-corda/build/nodes/AGCSIT": No such file or directory bash: "/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/bin/java": No such file or directory

But the paths are valid ones

1 Answer 1

2

Escaping the double quotes causes the shell to look treat them as literal parts of the filenames and parameters, instead of just it into a single token. There's no need to escape the quotes.

bash -c 'cd "/Users/Shammon/Projects/t2i-tokenisation-corda/build/nodes/AGCSIT" ; "/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/bin/java" "-Dcapsule.jvm.args=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5008 -javaagent:drivers/jolokia-jvm-1.6.0-agent.jar=port=7008,logHandlerClass=net.corda.node.JolokiaSlf4jAdapter" "-Dname=AGCSIT" "-jar" "/Users/Shammon/Projects/t2i-tokenisation-corda/build/nodes/AGCSIT/corda.jar"'

There's also no need for && exit at the end. When the command is done, the shell automatically exits.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.