Difference between single and double quotes in Bash

0 votes
In Bash, what are the differences between single quotes ('') and double quotes ("")?
Jun 7, 2022 in Linux Administration by Rahul
• 3,380 points
296 views

1 answer to this question.

0 votes
Single statements will not add anything, however twofold statements will. For instance: factors, backticks, certain \ get away, and so on.

Model:

$ reverberation "$(echo "upg")"
upg
$ reverberation '$(echo "upg")'
$(reverberation "upg")
The Bash manual has this to say:

3.1.2.2 Single Quotes

Encasing characters in single statements (') jelly the strict worth of each person inside the statements. A solitary statement may not happen between single statements, in any event, when gone before by an oblique punctuation line.

3.1.2.3 Double Quotes

Encasing characters in twofold statements (") jam the strict worth of all characters inside the statements, except for $, ', \, and, when history extension is empowered, !. The characters $ and ' hold their unique significance inside twofold statements (see Shell Expansions). The oblique punctuation line holds its extraordinary importance just when followed by one of the accompanying characters: $, ', ", \, or newline. Inside twofold statements, oblique punctuation lines that are trailed by one of these characters are eliminated. Oblique punctuation lines going before characters without a unique significance are left unmodified. A twofold statement might be cited inside twofold statements by going before it with an oblique punctuation line. Whenever empowered, history extension will be performed except if a ! showing up in twofold statements is evaded utilizing an oblique punctuation line. The oblique punctuation line going before the ! isn't eliminated.

The extraordinary boundaries * and @ have unique significance when in twofold statements (see Shell Parameter Expansion).
answered Jun 7, 2022 by Korak
• 5,820 points

Related Questions In Linux Administration

0 votes
1 answer

Difference between root (/) and home directory (~) in terminal?

Root directory which is referred to as ...READ MORE

answered Jun 20, 2019 in Linux Administration by Vicky
25,808 views
0 votes
1 answer

What is the difference between ctrl z and ctrl c in command line?

Hi@akhtar, Generally, these two commands are used to ...READ MORE

answered Feb 24, 2020 in Linux Administration by MD
• 95,440 points
45,104 views
0 votes
0 answers

Difference between ctrl-z and "&" in linux

My understanding is that when you are ...READ MORE

Apr 13, 2022 in Linux Administration by Soham
• 9,700 points
293 views
0 votes
0 answers

Difference between "system" and "exec" in Linux?

What is the difference between system and ...READ MORE

Apr 26, 2022 in Linux Administration by Edureka
• 13,670 points
327 views
0 votes
1 answer

How to extract file base name without path and extension in bash?

You don't actually have to call the ...READ MORE

answered May 31, 2019 in Linux Administration by Shubham
• 13,490 points
5,487 views
0 votes
0 answers

What is the difference between a symbolic link and a hard link?

Recently I was asked this during a ...READ MORE

Apr 13, 2022 in Linux Administration by Rahul
• 9,670 points
210 views
0 votes
0 answers

What is the difference between ''find .'' and ''find /'' on linux command

I am solving overthewire bandit. I looked ...READ MORE

Apr 20, 2022 in Linux Administration by Edureka
• 13,670 points
257 views
0 votes
0 answers

What's the difference between .so, .la and .a library files?

I know an .so file is a kind of ...READ MORE

Apr 25, 2022 in Linux Administration by Edureka
• 13,670 points
410 views
0 votes
1 answer

Difference between single and double quotes in Bash

Single statements will not insert anything, yet ...READ MORE

answered Jun 10, 2022 in Linux Administration by Korak
• 5,820 points
312 views
0 votes
1 answer

How to keep quotes in Bash arguments?

utilizing "$@" will substitute the contentions as ...READ MORE

answered Jun 13, 2022 in Linux Administration by Korak
• 5,820 points
728 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP