Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
opcache committed Nov 8, 2020
1 parent 67fe993 commit eb4215d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions shell/if1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

##或
if [ "$b" = 11 ] || [ "$b" = "22" ];then
  echo $a
fi
##且的表达方式
if [ "$b" = 11 ] && [ "$b" = "22" ];then
  echo $b
fi


project="aaaaa"
if [[ ${project} =~ "aaa" ]]; then
cp aaa.txt bbb.txt
fi
if [[ ${project} =~ "ccc" ]]; then
cp aaa.txt ccc.txt
fi


project="aaaaa"
if [[ ${project} =~ "aaa" ]]; then
echo "aaa111"
else
echo "aaa222"
fi
if [[ ${project} =~ "ccc" ]]; then
echo "aaa555"
else
echo "aaa666"
fi


0 comments on commit eb4215d

Please sign in to comment.