[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: quotes around a variable
From: |
Greg Wooledge |
Subject: |
Re: quotes around a variable |
Date: |
Sat, 16 Apr 2022 10:24:24 -0400 |
On Sat, Apr 16, 2022 at 07:29:01PM +0800, wilson wrote:
> when doing bash script, I am somewhat confused that, when I should use
> Double quotes around the variable, when I should use single quotes around
> the variable, and when I don't need the quotes. can you help give a guide?
https://mywiki.wooledge.org/Quotes
https://mywiki.wooledge.org/BashGuide
Single quotes prevent all substitutions. Double quotes permit most
substitutions, but suppress word splitting and pathname expansion of
the results.