文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>谁能解决这个问题???

谁能解决这个问题???

时间:2005-04-25  来源:daniel_82

一个很好的UNIX,shell程序题。看看你的基础知识怎么样?

你能编出来嘛???

编写一个archive script程序。

满足1: 固定路径存档功能:把指定的路径名下的文件都用Current_date.tar          形式,保存在home directory下的back_up子目录下。

        Current_date格式为ddmmyy

满足2: 指定路径存档功能:把指定的路径名下的文件都用tar的压缩格式存在指定的路径名下,格式为directory name_current_date.tar。该功能用 -r的option 来指明。Current_date格式为ddmmyy。

 

ps:1。时间可以由两种方式决定,(i)-d mmyy (ii) -m mm  -y yy .

       后面一种情况下,如果只给出其中一个,比如-m 02,但没给出-y,那么就用系统当前的年。

    2:directory name 由-d option给出

    3:-r 给出满足2的条件

    4:-i 给出原文件的前5行。

    5:-v 给出原文件的详细情况

    6:-? 提供help文件

Some Examples (In the following examples, the command is given in bold, the output in courier and the comments enclosed in between / # :

$ archive -n -y 04 -d Tutorial

/# archive all file in the Tutorial sub-directory whose modification date is before March (the current month) 2004 and provide a count at the end of the execution #/

10 files archived

$ archive -v -d 0205 -d Tutorial

/# archive files from the Tutorial sub-directory whose modification date is before Feb 2005 in a verbose mode - meaning display a line of information about each file that is being archived #/

exercise1: last modified 2001 MAY

trial: last modified 2002 JAN

core: last modified 2003 FEB

exercise5: last modified 2004 JAN

$ archive -d 0304 -n ./Tutorial

/# archive files in the Tutorial sub-directory whose modification date is before March 2004 and provide a count at the end of the execution #/

10 files archived

$ archive -m 02 -y 04 -m 03 -r -y 03 -d Tutorial

/# here the same option is specified more than once. It is left to you to decide whether to accept this or reject this. If you decide to accept this, then you need to decide which date to use. I will use the latest date in the input - i.e the date will be March (03), 2003. The –r options requires that the scripts has to scan all the files in Tutorial sub-directory as well as its sub-directories #/

$ archive -h

/# will list some help on how to use the script #/


相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载