Created
December 30, 2017 15:17
-
-
Save ErnyTech/465d2ee22d7cec11e8a836ed49548993 to your computer and use it in GitHub Desktop.
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
ihexarray=( $(find . -type f -name "*.ihex") ) | |
for i in "${ihexarray[@]}" | |
do | |
out=$(echo $i | sed s/.ihex//) | |
xxd -r -p $i $out | |
perm=$(stat -c "%a" $i) | |
own=$(stat -c "%U:%G" $i) | |
chmod $perm $out | |
chown $own $out | |
mkdir ihex | |
mv $i ./ihex | |
done | |
hexarray=( $(find . -type f -name "*.HEX") ) | |
for i in "${hexarray[@]}" | |
do | |
out=$(echo $i | sed s/.ihex//) | |
xxd -r -p $i $out | |
perm=$(stat -c "%a" $i) | |
own=$(stat -c "%U:%G" $i) | |
chmod $perm $out | |
chown $own $out | |
mkdir hex | |
mv $i ./hex | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment