脚本内容
# !/bin/sh
DIR=`pwd`echo $DIR
for i in $DIR/*
do
if [ -d $i ]
then
echo $i
fi
done
中间出现的错误:
1. test: line 2: DIR: command not found
DIR=`pwd`添加了空格
2.test: line 6: [: missing `]'
if [ -d $i]少了空格
脚本内容
# !/bin/sh
DIR=`pwd`done
中间出现的错误:
1. test: line 2: DIR: command not found
DIR=`pwd`添加了空格
2.test: line 6: [: missing `]'
if [ -d $i]少了空格