Last active
September 15, 2017 20:22
-
-
Save Niklas9/cc5bff21fc8b2dcf5d1575e3b578ee3e to your computer and use it in GitHub Desktop.
shell script to extract files in-place from a tar archive
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 | |
if [ $# -eq 0 ] | |
then | |
echo "missing argument for file path to tar-archive" | |
exit 1 | |
fi | |
for file in $(tar -tf $1); | |
do | |
tar -xvf $1 $file | |
tar --delete -f $1 $file | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment