解压脚本
时间:2008-05-01 来源:剑心通明
<IFRAME name=google_ads_frame marginWidth=0 marginHeight=0 src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-4117525570087365&dt=1209632842453&lmt=1209308566&output=html&slotname=9298919995&correlator=1209632842421&url=http%3A%2F%2Fwww.bsdlover.cn%2Fhtml%2F79%2Fn-779.html&ref=http%3A%2F%2Fwww.bsdlover.cn%2Fhtml%2F6%2Fcategory-catid-6-page-2.html&frm=0&cc=100&ga_vid=3575145176550936600.1209632842&ga_sid=1209632842&ga_hid=1177457741&flash=9.0.115.0&u_h=768&u_w=1024&u_ah=715&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameBorder=0 width=250 scrolling=no height=250 allowTransparency></IFRAME>
特别感谢作者:tram兄
代码:
#!/bin/bash
UNPACK=1
if [ ${1##*.} = bz2 ] ; then
TEMP=${1%.*}
if [ ${TEMP##*.} = tar ] ; then
tar jxvf $1
UNPACK=$?
echo This is a tar.bz2 package
else
bunzip2 $1
UNPACK=$?
echo This is a bz2 package
fi
fi
if [ ${1##*.} = gz ] ; then
TEMP=${1%.*}
if [ ${TEMP##*.} = tar ] ; then
tar zxvf $1
UNPACK=$?
echo This is a tar.gz package
else
gunzip $1
UNPACK=$?
echo This is a gz package
fi
fi
if [ ${1##*.} = tar ] ; then
tar xvf $1
UNPACK=$?
echo This is a tar package
fi
if [ $UNPACK = 0 ] ; then
echo Success!
else
echo Maybe it is not a package or the package is damaged?
fi
代码:
#!/bin/bash
UNPACK=1
if [ ${1##*.} = bz2 ] ; then
TEMP=${1%.*}
if [ ${TEMP##*.} = tar ] ; then
tar jxvf $1
UNPACK=$?
echo This is a tar.bz2 package
else
bunzip2 $1
UNPACK=$?
echo This is a bz2 package
fi
fi
if [ ${1##*.} = gz ] ; then
TEMP=${1%.*}
if [ ${TEMP##*.} = tar ] ; then
tar zxvf $1
UNPACK=$?
echo This is a tar.gz package
else
gunzip $1
UNPACK=$?
echo This is a gz package
fi
fi
if [ ${1##*.} = tar ] ; then
tar xvf $1
UNPACK=$?
echo This is a tar package
fi
if [ $UNPACK = 0 ] ; then
echo Success!
else
echo Maybe it is not a package or the package is damaged?
fi
相关阅读 更多 +