linux 中的shell的小小问题

来源:百度知道 编辑:UC知道 时间:2024/05/17 05:31:36
某shell脚本内容如下:
read 001.sh
if [- d 001.sh]
them
echo"this is a directory"
do
echo"this is not a dirctory"
fi
程序哪里有错?

你的脚本错的地方有点多,还是要写多几个多练练啊
#!/bin/bash
echo "input a name:"
read x
if [ -d $x ];then
echo "this is a directory";
else
echo "this is not a dirctory";
fi