Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

double quotes inside double quotes bash

'"'"'something'"'"' is equivalent to 'something'
"'"'"something"'"'" is equivalent to "something"

#Example usage
echo "hey "Dora""
>>hey Dora
echo "hey "'"'"Dora"'"'""
>>hey "Dora"
Comment

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
Comment

PREVIOUS NEXT
Code Example
Shell :: ubuntu add public key to server 
Shell :: add mirror list arch linux 
Shell :: subl command not found mac 
Shell :: how to check is heroku git remote is added 
Shell :: remove netdata ubuntu 
Shell :: node js TypeError [ERR_INVALID_ARG_TYPE]: The argument must be of type string. Received undefined 
Shell :: flask install venv 
Shell :: how to get deployment token from firebase 
Shell :: PDF Acrobat ubunut 
Shell :: install alacritty 
Shell :: yarn install raspberry pi 
Shell :: download sublime notepad ubuntu 
Shell :: bash delete file 
Shell :: Install pgAdmin for desktop mode 
Shell :: afficher le contenu de la variable path 
Shell :: git: create and remove git alias command 
Shell :: cmd substring replace 
Shell :: kubectl exec run command inside pod 
Shell :: conda install python image library 
Shell :: check linux file size 
Shell :: stop apache2 
Shell :: tar zip multiple files 
Shell :: bash compare two files 
Shell :: refresh desktop entries 
Shell :: fatal: invalid gitfile format 
Shell :: import external python modules in blender 
Shell :: git mirror repository 
Shell :: remove commit from github 
Shell :: shell script if input is empty 
Shell :: how to set up git user 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =