Skip to content

Instantly share code, notes, and snippets.

@Apipa169
Created March 29, 2023 09:40
Show Gist options
  • Save Apipa169/d1173c4ca4d122509de63cdb25ce78cc to your computer and use it in GitHub Desktop.
Save Apipa169/d1173c4ca4d122509de63cdb25ce78cc to your computer and use it in GitHub Desktop.
#!/bin/bash
folders=(
folder1
folder2
)
command=$1
for folder in "${folders[@]}"
do
echo "Executing command in folder $folder..."
cd "$folder"
eval "$command"
cd "../"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment