Untrarring data files

For example:
#!/bin/bash

#
# Created by Anar Manafov (A.Manafov@gsi.de)
#
# Script to look for tar:
# 1- find tar files starting from current dir
# 2- perform untarring
# 3 - delete source tar files
# usage: find -name '*.tar' -exec my_untar.sh {}  \;
#


SUCCESS=0


DIR=`/usr/bin/dirname $1`
tar -xvf $1 -C $DIR
if [ "$?" -eq $SUCCESS ]
then
echo "deleting $1"
rm -f $1
else
echo "skiping $1"
fi

-- AnarManafov - 31 May 2005
Topic revision: r4 - 2005-05-31, AnarManafov
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)