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 :: how to install etcher on centos 7 
Shell :: ubuntu install libgcc.i686 
Shell :: start powershell as different user 
Shell :: mongodb did not start 
Shell :: linux generate file of size 
Shell :: Error: `@cucumber/cucumber` module not resolvable. Must be locally installed. 
Shell :: install scikit learn 
Shell :: find node install location windows 
Shell :: centos epel-release 
Shell :: windows ssh-copy-id 
Shell :: wsl zsh get ip 
Shell :: to clear npx cache 
Shell :: get .net version 
Shell :: run production environment nodejs 
Shell :: where is path on klai linux 
Shell :: how to install terraform on Ubuntu/Debian 
Shell :: new branch not showing in visual studio 
Shell :: git checkout previous commit 
Shell :: install python mysqlclient on mac 
Shell :: npm install xlsx 
Shell :: merge child branch to parent git 
Shell :: bash merge pdf 
Shell :: difference between two files linux 
Shell :: composer install fast download 
Shell :: datatable npm install 
Shell :: sudo without password 
Shell :: sample bash script 
Shell :: how to configure httpd in amazon ec2 instance 
Shell :: Postman Collection Format v1 is no longer supported and can not be imported directly. You may convert your collection to Format v2 and try importing again. 
Shell :: command to update ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =