Skip to content

Instantly share code, notes, and snippets.

@nker150
Created February 3, 2023 05:06
Show Gist options
  • Save nker150/4b900840c254505c674fdf7d4a3f708c to your computer and use it in GitHub Desktop.
Save nker150/4b900840c254505c674fdf7d4a3f708c to your computer and use it in GitHub Desktop.
update.sh for parent directory
#!/bin/bash
function search_and_run() {
for dir in ./*; do
if [ -d "$dir" ]; then
cd "$dir"
if [ -f "$1" ]; then
bash "$1"
fi
search_and_run "$1"
cd ..
fi
done
}
search_and_run "update.sh"
search_and_run "clean.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment