Difference between single and double quotes in Bash

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

1 answer to this question.

0 votes
Single statements will not insert anything, yet 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 exacting 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 (") jelly the exacting worth of all characters inside the statements, except for $, ', \, and, when history extension is empowered, !. The characters $ and ' hold their exceptional significance inside twofold statements (see Shell Expansions). The oblique punctuation line holds its extraordinary significance 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 taken out. Oblique punctuation lines going before characters without a unique importance 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 circumvented utilizing an oblique punctuation line. The oblique punctuation line going before the ! isn't eliminated.

The unique boundaries * and @ have extraordinary importance when in twofold statements (see Shell Parameter Expansion).
answered Jun 10, 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
27,566 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,460 points
47,278 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,710 points
447 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,690 points
545 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,884 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,680 points
359 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,690 points
419 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,690 points
644 views
0 votes
1 answer

Difference between single and double quotes in Bash

Single statements will not add anything, however ...READ MORE

answered Jun 7, 2022 in Linux Administration by Korak
• 5,820 points
490 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
945 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