help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quotes around a variable


From: Alex fxmbsw7 Ratchev
Subject: Re: quotes around a variable
Date: Sat, 16 Apr 2022 15:47:30 +0200

i have figured as such.. quotes are when defining vars ( var=foo ) not
needed, where quotes overall, usually, are needed are when using vars as
arguments, eg ./app "$var" and also arr=( "$1" "$var" )

then when u need to preserve data, such as not interpreting $var in args (
./app '$foo is a var' )

then doublequotes u need where $var must get expanded

simply shortly so.. theres more to say anyway

greets


On Sat, Apr 16, 2022, 15:40 wilson <info@bigcount.xyz> 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?
>
> Thank you.
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]