octopusgrabbus
octopusgrabbus

Reputation: 10695

Is there a difference in how the sed -e string is quoted?

Whenever I have seen sed examples using -e the command string has usually been delimited by single, not double, quotes like this:

sed -e ' <command>' <input>
sed -e 's/CSV/csv/g' csv-instructions

Are there differences between using double and single quotes, and, if so, what are they?

Thanks.

Upvotes: 3

Views: 78

Answers (1)

deviantkarot
deviantkarot

Reputation: 146

The question is actually not about sed.

Quoting is a shell issue, and therefore depends on the shell you are using.

For example in bash, double quote allow the interpretation of special characters such as $ (variable expansion) or * (wildcard), whereas single quotes don't.

You can consult this page for a thorough explanation on the topic:

http://www.grymoire.com/Unix/Quote.html

[And you will likely will find other related posts on SO with more appropriate keywords :-) ]

Upvotes: 3

Related Questions