Bash rename extension recursive

后端 未结 6 1572
-上瘾入骨i
-上瘾入骨i 2020-12-29 09:32

I know there are a lot of things like this around, but either they don\'t work recursively or they are huge.

This is what I got:

find . -name \"*.so\         


        
6条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 10:16

    if you have Bash 4

    #!/bin/bash
    
    shopt -s globstar
    shopt -s nullglob
    for file in /path/**/*.so
    do
     echo mv "$file"  "${file/%.so}.dylib"
    done
    

提交回复
热议问题