Reputation: 13
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.
Upvotes: 0
Views: 49
Reputation: 382454
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";
Upvotes: 2