标签:解压脚本
#!/bin/bash
cd /lamp
ls * > ./list.txt
for a in $(cat list.txt)
do
if [[ "$a" =~ "tar" ]]
then
tar -xf $a
elif [[ "$a" =~ "tgz" ]]
then
tar -xf $a
elif [[ "$a" =~ "gz" ]]
then
gunzip $a
elif [[ "$a" =~ "bz" ]]
then
bunzip2 $a
elif [[ "$a" =~ "zip" ]]
then
unzip $a
else
echo "$a is not a zip file."
fi
done
本文出自 “凌宇的技术博客” 博客,谢绝转载!
标签:解压脚本
原文地址:http://lampit.blog.51cto.com/12958178/1932528