Skip to content

Instantly share code, notes, and snippets.

@okash1n
Created March 19, 2019 18:18
Show Gist options
  • Save okash1n/94c7bd0b22ad3a21aa6a98b528b336f6 to your computer and use it in GitHub Desktop.
Save okash1n/94c7bd0b22ad3a21aa6a98b528b336f6 to your computer and use it in GitHub Desktop.
#!/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