some modification on instpkg
[cmdllinux.git] / scripts / _tar_xz_files.sh
blob4d8178631950eed957e6e2cbe163593c23217aed
1 #tar xz targzs to destination
2 DIR="$1"
3 DIR2="$2"
5 [ ! -d "$DIR" ] && echo "No such source directory" && exit 1
6 [ ! -d "$DIR2" ] && echo "No such destination directory" && exit 1
8 DIR2=`cd "$DIR2" && pwd -P`
9 [ "$?" != 0 ] && echo "Cannot change to destination directory" && exit 1
11 cd "$DIR"
12 [ "$?" != 0 ] && echo "Cannot change to source directory" && exit 1
14 ls *.tar.gz 2> /dev/null | xargs -r -i tar xzf {} -C "$DIR2"