You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a=123 #intecho a #print aecho$a#print 123
hello="Hello World"echo$hello#Print Hello Worldecho${hello}#Print Hello Worldecho"$hello"#Print Hello Worldecho"${hello}"#Print Hello Worldecho'$hello'#Print $helloecho'${hello}'#Print ${hello}echo${#hello}#Prints the length of the variable
FILE="test1 test2.txt"
wc -m $FILE# attempts to count char of 2 files: `test1` and `test2.txt`
wc -m "$FILE"# attempts to count char of 1 files: `test1 test2.txt`
Set Local Variables & Scope
#local var='local varaible'func1(){
local var='func1 local'echo"In func1, var = '$var'"
func2
}
func2(){
echo"In func2, var = '$var'"
}
local var=global # as global
func1
echo"Global var = '$var'"
Environment Variables
Parameter
Description
$HOME
The current user's home directory.
$PATH
A colon-separated list of directories in which the shell looks for commands.