This file contains hidden or 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/sh | |
| # usage: ./tarex.sh example.tar.gz | |
| # will extract example.tar.gz, making sure it is always contained in a single | |
| # directory in the current directory | |
| # Keeps directory clean from "tar bombs" by creating a directory to extract the tar file into, | |
| # and then only copying the results back to the current directory if there is only one file | |
| # or directory, indicating that the results were contained in one directory |