1
我有這個目錄。如何遞歸地去每個文件夾並執行同名的shell腳本?
.
├── animation
│ ├── animation-events
│ │ ├── app.js
│ │ ├── app.mustache.json
│ │ ├── create_view.sh
│ │ └── assets
│ │ └── dummy_character_sprite.png
│ └── change-frame
│ ├── app.js
│ ├── app.mustache.json
│ ├── create_view.sh
│ └── assets
│ └── dummy_character_sprite.png
├── app.css
├── app.mustache
├── bunch_of_functions.js
├── decorators.js
├── create_all_views.sh
└── displaying-a-static-image
├── app.js
├── app.mustache.json
├── create_view.sh
└── assets
└── piplup.png
我要爲create_all_views.sh
在孩子目錄中執行所有create_view.sh
。我怎麼能做到這樣的事情?
很好,'\;'用於什麼? – notalentgeek
'\;'用於表示參數結束到'-execdir'。例如,你可以在它後面有更多選項,例如'find path/to/dir -name create_view.sh -execdir ./create_view.sh \; -print -ls' – janos
如何執行多個命令?我找到了$(dirname $ 0)-name create_view.sh -execdir chmod + x ./create_view.sh \ ./create_view.sh \;'但是它返回''chmod + x'上沒有這樣的文件或目錄' 。 – notalentgeek