返回语句错误:urn:只能从shell脚本中的函数或源脚本中“返回” myscript.sh
#!/bin/bash
if [ $# -ne 2 ]
then
echo "Incorrect Usage : Arguments mismatch."
return 2
fi
mv $1 $2
return 0
当我尝试跑步时
sh myscript.sh
Incorrect Usage : Arguments mismatch.
myscript.sh.sh: line 5: return: can only `return' from a function or sourced script
如何解决该错误?