0

I am trying to create a String which has the below value, but I am getting a syntax error. can anyone please help on this.

tr -d '\15\32' < shell.sh > com.sh

I need the final output in a String something like the above. This is what I've tried:

String s = "tr -d '\15\32' < shell.sh > com.sh";

But I am getting an error for the above code.

1
  • 1
    "i am getting error" is never enough information. Always give the exact error message. Commented Aug 12, 2014 at 13:30

1 Answer 1

2

A \ in a string literal starts an escape sequence.

Double the \ in a string literal :

String s = "tr -d '\\15\\32' < shell.sh > com.sh";
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.