Linux环境下写一个脚本 从键盘让用户输入几个文件,脚本能够将此几个文件归档压缩成一个文件: 1.首先介绍一下case语句格式 case SWITCH in value1) statement ... ;; value2) statement ... ;; *) statement ... esa ...
分类:
系统相关 时间:
2018-04-26 01:23:40
阅读次数:
365
vimmytar.sh#!/bin/bash
#
read-p"Threefiles:"file1file2file3
read-p"Destination:"DEST-->指定压缩存放目录及文件名称
read-p"Compress[gzip|bzip2}xz]:"COMP-->输入压缩的格式
case$COMPin
gzip)
tar-zcf${DEST}.tar.gz$file1$file2$file3
;;
bzip2)
tar-jcf${DEST}...
分类:
其他好文 时间:
2015-08-25 16:57:06
阅读次数:
141