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 🔗

URL: https://askubuntu.com/q/1037190
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"
done

Using this reference you can use nested for loops:

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