문제

A python.py script lies in a directory that is above the directories date and data. Each data directory contains two ON and OFF directories as ~/dir_pyhton.py/dir_dates/dir_data/dir_ON, dir_OFF How can the python script be pointed to run in dir_ON and dir_OFF with a bash or tcsh command? - or another way?

도움이 되었습니까?

해결책

You can use the find command to locate the ON and OFF directories, then pass them to the python script, like so:

cd ~/dir_pyhton.py/
find dir_dates/dir_data -type d \( -name "dir_ON" -or -name "dir_OFF" \) | xargs python python.py
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top