Created
March 19, 2019 18:18
-
-
Save okash1n/94c7bd0b22ad3a21aa6a98b528b336f6 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
#!/bin/bash | |
# init | |
## check OS | |
if [ "$(uname)" == 'Darwin' ]; then | |
OS='Mac' | |
elif [ "$(expr substr $(uname -s) 1 5)" == 'Linux' ]; then | |
OS='Linux' | |
elif [ "$(expr substr $(uname -s) 1 10)" == 'MINGW32_NT' ]; then | |
OS='Cygwin' | |
else | |
echo "Your platform ($(uname -a)) is not supported." | |
exit 1 | |
fi | |
## set command | |
if [ "$OS" == 'Mac' ]; then | |
rl="greadlink -f" | |
else rl="readlink -f" | |
fi | |
## cd | |
script_dir_path=$(dirname $(${rl} -f $0)) | |
cd ${script_dir_path} | |
# func | |
for file in `find *.tar.*`; do | |
tar xvf ${file} | |
rm ${file} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment