Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash 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

bash get text inside quotes

# <command which return text containing quotes> | cut -d " -f2
VBoxManage list vms | cut -d " -f2
Comment

PREVIOUS NEXT
Code Example
Shell :: git clone only single file 
Shell :: remove a file from git commit history 
Shell :: git undo 
Shell :: run command every hour linux 
Shell :: how to install uvicorn 
Shell :: or push an existing repository from the command line 
Shell :: pull from other branch 
Shell :: how to check linux is ubuntu or centos 
Shell :: how to restore default apache httpd conf file 
Shell :: git commit with message 
Shell :: powershell start job 
Shell :: how to make pyinstaller build python program not open command prompt 
Shell :: how to scan for raspberry pi on network windows 
Shell :: wget - 
Shell :: Bash test if variable is a number 
Shell :: create a branch from old commit 
Shell :: append a string in all files name linux 
Shell :: apt install package version 
Shell :: renaming branch in git 
Shell :: ubuntu bash script exit when error 
Shell :: ubuntu path of saving screenshots 
Shell :: delete github repository without browser 
Shell :: how to git clone a specific branch 
Shell :: docker remove 
Shell :: github start 
Shell :: example bash script 
Shell :: failed: Invalid argument 
Shell :: bash escape all special characters 
Shell :: create a new file in bash script 
Shell :: make atom default editor in git 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =