Skip to main content
Post Closed as "Duplicate" by cuonglm bash
Clarified question
Source Link
Arronical
  • 280
  • 2
  • 12

When should What situations exist where Bash variables should not be double quoted?

I'm aware of several situations where it's unnecessary to use double quotes when expanding a variable in Bash, such as inside [[...]], or when used on the right hand side of a variable assignment.

When reading about quoting variables I often hear that it's often better to just use double quotes everywhere, as there are only a very few cases where you wouldn't want them.

What are the cases where behaviour from quoting is undesirable? I'm not talking about situations where you don't need to quote, but where quoting a variable will actively stop something from working.

When should Bash variables not be double quoted?

I'm aware of several situations where it's unnecessary to use double quotes when expanding a variable in Bash, such as inside [[...]], or when used on the right hand side of a variable assignment.

When reading about quoting variables I often hear that it's often better to just use double quotes everywhere, as there are only a very few cases where you wouldn't want them.

What are the cases where behaviour from quoting is undesirable?

What situations exist where Bash variables should not be double quoted?

I'm aware of several situations where it's unnecessary to use double quotes when expanding a variable in Bash, such as inside [[...]], or when used on the right hand side of a variable assignment.

When reading about quoting variables I often hear that it's often better to just use double quotes everywhere, as there are only a very few cases where you wouldn't want them.

What are the cases where behaviour from quoting is undesirable? I'm not talking about situations where you don't need to quote, but where quoting a variable will actively stop something from working.

Source Link
Arronical
  • 280
  • 2
  • 12

When should Bash variables not be double quoted?

I'm aware of several situations where it's unnecessary to use double quotes when expanding a variable in Bash, such as inside [[...]], or when used on the right hand side of a variable assignment.

When reading about quoting variables I often hear that it's often better to just use double quotes everywhere, as there are only a very few cases where you wouldn't want them.

What are the cases where behaviour from quoting is undesirable?