#!/bin/sh
#if then
function test1()
{
local RET=0
if [ $RET -eq 0 ];then
echo "yes"
else
echo "no"
fi
}
#[]
function test2()
{
local RET=0
[ $RET -eq 0 ] && echo "yes" || echo "no"
}
#[[]]
function test3()
{
local RET=0
[[ $RET -eq 0 ]] && echo "yes" || echo "no"
}
#test
function test4()
{
local RET=0
test $RET -eq 0 && echo "yes" || echo "no"
}
test1
test2
test3
test4
#if then
function test1()
{
local RET=0
if [ $RET -eq 0 ];then
echo "yes"
else
echo "no"
fi
}
#[]
function test2()
{
local RET=0
[ $RET -eq 0 ] && echo "yes" || echo "no"
}
#[[]]
function test3()
{
local RET=0
[[ $RET -eq 0 ]] && echo "yes" || echo "no"
}
#test
function test4()
{
local RET=0
test $RET -eq 0 && echo "yes" || echo "no"
}
test1
test2
test3
test4