I have three variables:
VAR1="file1"
VAR2="file2"
VAR3="file3"
How to use and (&&
) operator in if statement like this:
if [ -f $VAR1 && -f $VAR2 && -f $VAR3 ]
then ...
fi
When I write this code it gives error. What is the right way?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…