Linux Shell Learning

-- ECHO command
var = 'Hello World!'
echo 'var =' $ var
 
 
 
 
-- LOGICAL
 
---- &&    command :
---- ---- command1 && command2
---- ---- ---- if command1 is true, then execute command2; if command1 is false, then not execute command2.
---- ||    command :
---- ---- command1 || command2
---- ---- ---- if command1 is true, then not execute command2; if command1 is false, then execute command2. 
 
---- &&   condition:
---- ---- [[  bool-expression1  &&  bool-expression2  ]]
---- ||     condition:
---- ---- [[  bool-expression1  ||  bool-expression2  ]]
 
----    -a  condition:
---- ---- [  bool-expression1  -a  bool-expression2  ]
---- -a condition:

---- ---- [ bool-expression1  -o  bool-expression2  ]

Guess you like

Origin www.cnblogs.com/lnlidawei/p/12484029.html