Need help in bash script and awk command

前端 未结 2 1043
滥情空心
滥情空心 2021-01-27 06:06

I need a bash script to print folder names and file names recursively (in stdo/p). For example: i have a folders structure like /earth/plants/flowers/rose/rose.jpg.



        
2条回答
  •  猫巷女王i
    2021-01-27 06:43

    awk -F"/" '{
        print "\n planet=", $2, "\n category=", $3, "\n sub cat=", $4
        for (i = 5; i < NF; i++) print " add cat=", $i
        print " Name=",$NF
    }'
    

提交回复
热议问题