美文网首页
2018-08-13

2018-08-13

作者: 李不韦 | 来源:发表于2018-08-13 21:42 被阅读0次

    shell写正则表达式=~后面必须不加双引号


    image.png

    !/bin/bash

    function getdir(){
    for element in ls $1
    do
    dir_or_file=1element
    if [ -d dir_or_file ] then getdirdir_or_file
    else
    if [[ "dir_or_file ]]
    then
    echo dir_or_file fi if [[ dir_or_file" =~ .sh]] then echodir_or_file
    fi
    fi
    done
    }
    root_dir="/home/work/mingyouchen/libowei"
    getdir $root_dir

    相关文章

      网友评论

          本文标题:2018-08-13

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