当前位置: 技术问答>linux和unix
shell解压缩
来源: 互联网 发布时间:2016-04-23
本文导语: #!/bin/sh ftype=`file "$1"` case "$ftype" in "$1: Zip archive"*) unzip "$1" ;; "$1: gzip compressed"*) gunzip "$1" ;; "$1: bzip2 compressed"*) bunzip2 "$1" ;; *)echo "Error: File $1 can not be umcompressed with sm...
#!/bin/sh
ftype=`file "$1"`
case "$ftype" in
"$1: Zip archive"*)
unzip "$1" ;;
"$1: gzip compressed"*)
gunzip "$1" ;;
"$1: bzip2 compressed"*)
bunzip2 "$1" ;;
*)echo "Error: File $1 can not be umcompressed with smartzip" ;;
esac
为什么解压作不了文件?我有个lastmod.tar的文件,正常能解压缩,用这个shell就不行。
ftype=`file "$1"`
case "$ftype" in
"$1: Zip archive"*)
unzip "$1" ;;
"$1: gzip compressed"*)
gunzip "$1" ;;
"$1: bzip2 compressed"*)
bunzip2 "$1" ;;
*)echo "Error: File $1 can not be umcompressed with smartzip" ;;
esac
为什么解压作不了文件?我有个lastmod.tar的文件,正常能解压缩,用这个shell就不行。
|
*.tar
文件类型是 POSIX tar archive (GNU)
文件类型是 POSIX tar archive (GNU)