2012-10-29 5 views
0

가능한 중복 : - 그것은 더 이상 말보다 오래 걸리는 경우 나는 $ 출력을 시간 제한하려면 어떻게bash 스크립트에서 시간 초과하는 방법은 무엇입니까?

for test in `ls Tests`; do 

for file in `ls FileFolder`; do 

output=`python devcap $test $file` 

echo $test $file $output >>result.txt 

done 

done 


Timeout a command in bash without unnecessary delay

그래서 이것은 내가 뭘하려고 오전입니다 5 초 후에 다음 $ 파일로 이동 하시겠습니까?

stderr도 result.txt로 리디렉션 할 수 있습니까?

+1

http://stackoverflow.com/questions/687948/timeout-a-command-in-bash-without-unnecessary-delay – doublesharp

답변

0

이 시도 :

for test in `ls Tests`; do 

for file in `ls FileFolder`; do 

output=`python devcap $test $file` 

sleep 5 

echo $test $file $output >>result.txt 

done 

done 
+0

I가 작동하지 it.Its을 시도했다. 이 코드는 셸을 끊어 앞으로 움직이지 않습니다. – user1738845

+0

코드에 sleep 5를 추가하려고 시도한 적이 있습니까? btw 내 대답을 업데이트했습니다. –

관련 문제