美文网首页
shell-判断是否是文件

shell-判断是否是文件

作者: keaidelele | 来源:发表于2017-08-14 22:47 被阅读69次

!/bin/bash

function getdir(){
for element in ls $1
do
dir_or_file=$1"/"$element
if [ -d $dir_or_file ]
then
getdir $dir_or_file
else
echo $dir_or_file
fi
done
}
root_dir="fungi"
getdir $root_dir
~

相关文章

  • shell-判断是否是文件

    !/bin/bash function getdir(){for element in ls $1dodir_or...

  • 判断是否是文件

    NSFileManager *fileManager = [NSFileManager defaultManage...

  • php 文件操作

    文件读取内容 方式一: 方式二: 方式三: 判断文件是否存在 判断是否是文件 file_exists不仅可以判断文...

  • 常用shell脚本

    -d 文件夹---- 判断文件夹是否存在-f 文件 ----- 判断文件是否存在echo "" ---...

  • shell 判断

    判断逻辑,文件,权限,数值 文档类型判断 -f 判断filename是否为文件 -d 判断filename是否为...

  • golang判断文件或文件夹是否存在

    go判断文件或文件夹是否存在 文件/文件夹是否存在/*** function 判断文件/文件夹是否存在* para...

  • Foundaton框架-->NSFileManager

    1.判断一个文件或者文件夹是否存在 2.判断一个文件是否存在, 并且判断它是否是一个文件夹 3.获取文件或文件夹的...

  • Linux 判断文件或文件夹是否存在

    判断文件是否存在 判断文件夹是否存在 切记 一个是 -d 一个是 -f 文件比较符

  • 判断文件是否是pdf

    c函数strnstr(char* s1, chars2, int pos1) 各个参数的含义/* strnstr ...

  • shell-判断

    文件测试-操作符:-gt 大于 | -lt 小于 | -eq 等于 | -ne 不等于 | ...

网友评论

      本文标题:shell-判断是否是文件

      本文链接:https://www.haomeiwen.com/subject/kivprxtx.html