Find Jobs
Hire Freelancers

Bash scripts

$10-30 USD

已取消
已发布大约 9 年前

$10-30 USD

货到付款
Write Bash scripts to do each of the following: 1) Write a script called ‘my_which’ that does the same thing as the Unix which command, but do it using a for loop over an if. Obviously, DO NOT call bash’s built-in `which` . 2) Write a script called dircheck that takes one or more directory names as argument and displays the following information about each directory argument: a. display a count of the number of subdirectories anywhere under this directory. b. display a count of the number of files in the directory. c. list all of the files in the directory that are zero length (you may use the ‘find’ command for this) d. use ‘du’ to display the amount of storage space used by this directory e. To test your script, you should create some subdirectories, some files that are zero length, using touch, and some files that are not zero length using vi, output redirection, or cp. f. Example of use $ dircheck ~/hw ~/bin 3) Write a bash script called `my_find` that does a subset of the find command. Obviously, DO NOT use `find` in your solution. You must handle (at least) the following options as described in the manual for find (and these will be tested for grading): -name (you should handle patterns for names), -type (f and d), -print, and -exec (you must handle {} for exec (hint: use sed), but you may assume the exec, if present, is always the last argument and, therefore, need not be terminated by a semicolon. Note also the predicates can come in any order and are implicitly short circuit ANDed together. You need not handle -o which is OR. Here is a sample command: $ my_find $HOME -name ‘*.o’ -type f -print -exec /bin/mv {} ~/.TRASH \;
项目 ID: 7210101

关于此项目

远程项目
活跃9 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作

关于客户

UNITED STATES的国旗
los angeles, United States
4.9
10
付款方式已验证
会员自11月 2, 2014起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。