#!/bin/bash
use=cat
cat_greet()
{
echo "hello cat"
}
if [ $use=cat ]
then
cat_greet
fi
no_exit=1
[[ $no_exit -eq 1 ]]&& exit(){true;}
exit
这个程序输出结果为 hello cat
我想问的是
[[ $no_exit -eq 1 ]]&& exit() {true;}
这一句怎么理解?
#!/bin/bash
use=cat
cat_greet()
{
echo "hello cat"
}
if [ $use=cat ]
then
cat_greet
fi
no_exit=1
[[ $no_exit -eq 1 ]]&& exit(){true;}
exit
这个程序输出结果为 hello cat
我想问的是
[[ $no_exit -eq 1 ]]&& exit() {true;}
这一句怎么理解?