Created
March 7, 2018 10:04
-
-
Save rossmc/7ab5dbb60cb52c5f4a43baa5099ca049 to your computer and use it in GitHub Desktop.
Bash script for running commands on array of files etc. Useful for running diff commands on files from different directories.
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/bash | |
# cmd='diff -qur -I ".*2006.*"' | |
# cmd='diff' | |
# cmd='git diff' | |
cmd='diff -q' | |
# cmd='cp' | |
# cmd='rm' | |
# cmd='echo diff' | |
# cmd='ls -alh' | |
# args='".*2006.*"' | |
# src_path='/var/www/html/var/magento-ee1.13.0.2/' | |
src_path='/var/www/html/var/PATCHEDmagento-ee1.13.0.2/' | |
dest_path='/var/www/html/' | |
array=( | |
app/code/core/Mage/Customer/Model/Resource/Customer.php | |
app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php | |
) | |
for i in "${array[@]}" | |
do | |
# echo $i | |
eval $cmd $src_path$i $dest_path$i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment