Quantcast
Channel: How to echo `single quote` when using single quote to wrap special characters in shell? - Unix & Linux Stack Exchange
Browsing all 5 articles
Browse latest View live

Answer by alexh for How to echo `single quote` when using single quote to...

In case someone else comes along for putting a mix of single and double quotes into a file, this is working too: cat > its-shell-programing.txt << __EOF__ echo $'It\'s Shell Programming' echo...

View Article



Answer by mikeserv for How to echo `single quote` when using single quote to...

You can use: sed "s/'"'/&\\&&/g s/.*/'"'&'"'/ ' <<IN $arbitrary_value IN To safely shell quote a value line per line. Shell depending, you might also have the option to do: printf...

View Article

Answer by Mikel for How to echo `single quote` when using single quote to...

The tutorial is wrong. POSIX says: A single-quote cannot occur within single-quotes. Here's some alternatives: echo $'It\'s Shell Programming' # ksh, bash, and zsh only, does not expand variables echo...

View Article

How to echo `single quote` when using single quote to wrap special characters...

I'm reading shell tutorial today from http://www.tutorialspoint.com/unix/unix-quoting-mechanisms.htm In which it mentions: If a single quote appears within a string to be output, you should not put...

View Article

Answer by John Griffith for How to echo `single quote` when using single...

echo "He said to me, \"I've seen that.\""Seems to me to be the simplest way to return the text:He said to me, "I've seen that."

View Article

Browsing all 5 articles
Browse latest View live




Latest Images