문제

I have 35 distinct directories, named case1 to case35 respectively. I have the same shell script in each of them and I was wondering if there is a way to execute it in every directory at once.

도움이 되었습니까?

해결책

In csh:

foreach d (case*)
  $d/script &
end

Or you can use sh/bash which gives a better programatic interface:

for d in case*; do $d/script & done

Add a cd before running the script if you want to be in the directory when executing the script.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top