Bash rename extension recursive

后端 未结 6 1584
-上瘾入骨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 09:57

    What is wrong is that

    echo {} | sed s/.so/.dylib/
    
    is only executed once, before the find is launched, sed is given {} on its input, which doesn't match /.so/ and is left unchanged, so your resulting command line is
    find . -name "*.so" -exec mv {} {}
    

提交回复
热议问题