[英]point a python script to run in multiple subdirectories
A python.py script lies in a directory that is above the directories date and data. python.py脚本位于目录日期和数据上方的目录中。 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?
每个数据目录都包含两个ON和OFF目录,分别为〜/ dir_pyhton.py / dir_dates / dir_data / dir_ON,dir_OFF,如何使用bash或tcsh命令将python脚本指向在dir_ON和dir_OFF中运行? - 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: 您可以使用
find
命令找到ON和OFF目录,然后将它们传递给python脚本,如下所示:
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 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.