我想通过返回值来查询函数。我的代码如下;
check(){
file=/root/Turkiye.txt
local funkx=$1
while read line; do
if [ "$line" == "$funkx" ]
then
true
break
else
false
fi
done < $file
}
printf "Please enter the value : "
read keyboard
if check $keyboard;
then
echo "yes";
else
echo "no";
fi
Run Code Online (Sandbox Code Playgroud)
它不起作用,我做错了什么?