LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 910|回复: 0

初学者请教一简单shell问题

[复制链接]
发表于 2009-11-7 06:26:39 | 显示全部楼层 |阅读模式
这里有两道题,请大家帮帮忙,英文版的如下:
(1) Write a script modify with the following syntax:

  modify [-r] [-l|-u] <dir/file names...>
  modify [-r] <sed pattern> <dir/file names...>
  modify [-h]

which will modify file and directory names. The script is dedicated to lowerizing (-l)
file names, uppercasing (-u) file names or internally calling sed
command with the given sed pattern which will operate on file names.
Changes may be done either with recursion (-r) or without it.

(2) Write a second script, named modify_examples, which will lead the tester of the modify script through the typical, uncommon and even incorrect scenarios of usage of the modify script.
Please, use only pure sh!

翻译成中文,题目大体意思应该是
(1)写个脚本,可以更改文件名和目录名,是名称由小写改为大写,或者由大写改为小写,可以批量修改。或者调用sed命令进行操作。可以采用循环操作方式,也可以不采用循环。
(2)写一个脚本,命名为modify_examples,实现可以让脚本测试者通过一些不正常的,甚至错误的操作,脚本对其抛出异常或者提示,引导测试者正确使用。(任何异常都可以。)

本人刚开始接触学习Shell,希望能得到些提示或者解答供小弟研究学习。不胜感激。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表