Answers for "bash or and"

4

bash or

if [ "$1" = "a.txt" ] || [ "$2" = "c.txt" ]; then
	# do smt...
fi
Posted by: Guest on October-15-2020
2

and in bash

Logical AND (&&)

if [1 -gt 0 ] && [ 2 -gt 1 ]; then 
	echo 1;
fi
 
 Logical OR (||)
 
 if [1 -gt 0 ] || [ 2 -gt 1 ]; then 
	echo 1;
 fi
Posted by: Guest on March-03-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language