关于一个SHELL脚本的问题?
不知道为什么,我进行shell编程的时候,到判断语句的时候,总是无法正确执行
代码如下:
#!/bin/sh
echo -e "Please enter file name: "
read file
if [ -f $file ]
then
echo Find the file $file
else
echo Don't find the file $file
fi
当执行到 [ -f $file ] 就会出现错误,我用的是 red hat linux 7.1,shell:/bin/bash