下午好,
下面列出的我的代码在恢复已删除的文件时遇到问题。我弹出此错误,说我的第5行整数表达式是预期的。我很高兴收到您的反馈。
#!/bin/bash
FileP="$(grep -i "$1" $HOME/.restore.info | cut -d ":" -f1)"
FileN="$(grep -i "$1" $HOME/.restore.info | cut -d":" -f2)"
echo "FileN"
if [ $1 -eq 0 ]
then
echo "No input detected"
exit 1;
elif [ "$FileN" = "$1" ]
then
echo "File found sending back to original location"
mv ~/deleted/$1 $FileP
else
echo "File does not exist"
exit 2;
fi