(安西) 发表于 2018-8-21 11:46:03

shell:case

ftype=`file “$1″` # Note ‘ and ` is different  case “$ftype” in
  “$1: Zip archive”*)
  unzip “$1″ ;;
  “$1: gzip compressed”*)
  gunzip “$1″ ;;
  “$1: bzip2 compressed”*)
  bunzip2 “$1″ ;;
  *) echo “File $1 can not be uncompressed with smartzip”;;
  esac

页: [1]
查看完整版本: shell:case