Horje
bash single vs double quotes Code Example
bash single vs double quotes
# Short answer:
# Single quotes don't allow interpolation, but double quotes do

# Long answer:
# From wikipedia:
# In computer programming, string interpolation (or variable interpolation,
# 	variable substitution, or variable expansion) is the process of evaluating
# 	a string literal containing one or more placeholders, yielding a result in
# 	which the placeholders are replaced with their corresponding values.

# Concrete example:
echo "$(echo 'word')" # here, "$(echo 'word')" gets interpolated (interpreted)
--> word

echo '$(echo "word")' # here, '$(echo "word")' is echoed literally (no interpolation)
--> $(echo "word")

# Note, this link also has some good info:
https://stackoverflow.com/questions/10067266/when-should-i-wrap-quotes-around-a-shell-variable/42104627#42104627




Shell

Related
linux bring process to foreground Code Example linux bring process to foreground Code Example
vim strip trailing whitespace Code Example vim strip trailing whitespace Code Example
ubuntu delete files older than 5 days Code Example ubuntu delete files older than 5 days Code Example
cloning repository github Code Example cloning repository github Code Example
samtools sam to fastq Code Example samtools sam to fastq Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12