user3078794
user3078794

Reputation: 9

Slash before quotation mark in bash?

Do anyone know how to solve a problem with slash before quotation mark ?? for example, I want to show a text in console that looks like this :

"/ Text Text Text Text Text Text Text \"

but there is problem with \" console don't like it.

I searched for it in google but didn't find anything...

Upvotes: 0

Views: 181

Answers (2)

Avinash Raj
Avinash Raj

Reputation: 174706

Enclose all your text inside single quotes. Bash won't parse the codes present inside single quotes.

echo '"/ Text Text Text Text Text Text Text \"'

Upvotes: 0

choroba
choroba

Reputation: 241858

Backslash is a special character in double quotes. In single quotes, it has not special meaning:

echo '"/ Text Text \"'

In double quotes, it's used to escape special characters - and it can escape itself:

echo "/ Text Text \\"

Upvotes: 5

Related Questions