Last active
February 9, 2016 11:14
-
-
Save mo6020/fd439c86ec79660ac3e0 to your computer and use it in GitHub Desktop.
Convert Netapp body.7z to old style ASUP for ConfigAdvisor offline - Credit to @JK-47 for this, not my work..
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
# Make all text type file names upper case | |
perl -e 'for(@ARGV){rename$_,uc}' *.txt | |
perl -e 'for(@ARGV){rename$_,uc}' *.xml | |
# Replace underscores with DASHES | |
perl -e 'do { (my $f = $_) =~ tr/_/-/; rename $_, $f } for glob "@ARGV"' *.XML | |
perl -e 'do { (my $f = $_) =~ tr/_/-/; rename $_, $f } for glob "@ARGV"' *.TXT | |
# Save @JK-47's asupsections.txt to the directory. (This is just | |
# headers and helps me call to the other files) | |
wget http://www.jk-47.com/wp-content/uploads/2015/06/asupsections.txt | |
# Merge the files into legacy format. | |
ASUPFILE="`grep X-Netapp-asup-hostname X-HEADER-DATA.TXT | awk '{print $2}'`_asup.txt" | |
echo $ASUPFILE | |
for i in `awk -F"===== " '{print $2}' asupsections.txt | awk -F" =====" '{print $1}'`; do echo "===== "$i" =====" >> $ASUPFILE ; cat $i.TXT >> $ASUPFILE; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment