Created
October 11, 2017 23:49
-
-
Save nikhilsuvarna/6829d5bac44fae5baf45e74e040112b8 to your computer and use it in GitHub Desktop.
extract a file from multiple tar bundles that have the same file name
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
for i in `ls -1 logs` | |
do | |
# for j in `$i | awk -F "." '{print $1"."$2}'` | |
# do | |
tar --strip-components=2 -xvf logs/$i consul_agent/consul_agent.stdout.log | |
mv consul_agent.stdout.log consul_agent_`echo $i | awk -F "." '{print $1"."$2}'` | |
#echo $i |awk -F "." '{print $1"."$2}' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment