Python Execute Shell Script And Condition In For Loop