Merge remote-tracking branch 'origin/master'

# Conflicts:
#	.gitignore
This commit is contained in:
Rinsvent 2022-08-16 20:44:25 +07:00
commit c43c16eb8d
2 changed files with 35 additions and 0 deletions

11
src/condition.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
equal() {
local RETURN
RETURN=0
if [[ "$1" = "$2" ]];
then
RETURN=1
fi
echo $RETURN
}

24
src/condition.test.sh Normal file
View File

@ -0,0 +1,24 @@
#!/bin/bash
. ./condition.sh
# equal
if [ $(equal 1 1) -eq 1 ]
then
echo "equal numeric"
fi
if [[ $(equal 1 2) -eq 0 ]]
then
echo "not equal numeric"
fi
if [[ $(equal "asdf" "asdf") -eq 1 ]]
then
echo "equal string"
fi
if [[ $(equal "asdf" "asdf1") -eq 0 ]]
then
echo "not equal string"
fi