The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

Views: 9,808     Votes:  2     ✅ Solution
Tags: command-line   bash  
Link: 🔍 See Original Answer on Ask Ubuntu 🔗

Title: Bash script to run python script for all images in all subdirectories
ID: /2018/05/17/Bash-script-to-run-python-script-for-all-images-in-all-subdirectories
Created: May 17, 2018
Upload: November 24, 2022    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false

From Super User they tell us how to loop through sub-directories:

for d in */ ; do
    echo "$d"

Using this reference you can use nested for loops:

for d in */ ; do
    for file in "$d"/*.jpg
        python /"$file" /"$file"
⇧ Don't see new kernel after upgrade how to time a certain part of an executable?  ⇩