Saturday, July 14, 2018

linux - Print single quotes in shell script using option -c

This may sound novice but I tried everything to get this to work.

I want to print a word with single quotes : 'John' in shell script. I cant replace /bin/bash -l -c as this part of code is run by Java and I have to pass the shell command as a string. I tried with echo -e option as well.



/bin/bash -l -c 'echo "'John'"'


The output I want is:



'John'



I tried escaping the single quotes but nothing helped so far. Any ideas?

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...