Created
July 25, 2019 16:22
-
-
Save aerouk/6c108f3b76a8c1ae8f84621d32424980 to your computer and use it in GitHub Desktop.
Gets the first jpg in a subdir of the current dir and copies it where the command was executed as the subdir name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for dir in */; do | |
for file in "$dir"*.jpg; do | |
cp "$file" "${file%/*}.jpg" | |
break 1 | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment