取当前路径
currentpath = $PWD
 
遍历根目录
for file in /*
  do
  if test -f $file
  then
    echo 是文件
  fi
  if test -d $file
  then
    echo 是目录
  fi
  if test -x $file
  then
    echo 可执行
  fi
  if test -w $file
  then
    echo 可写
  fi
  echo $file
done
 
评论
发表评论

您还没有登录,请登录后发表评论

squall
搜索本博客
最近加入圈子
存档
最新评论
评论排行榜