早教吧 育儿知识 作业答案 考试题库 百科 知识分享

麻烦大虾帮我搞定这个shell编程Implementwc(workcount)ofUnix.Then,useyourprogramtowriteashellscripttoexaminethecontentofsomefilesandshowtheresultinaniceformatwithappropriateheaders.Then,sorttheresultbasedon

题目详情
麻烦大虾帮我搞定这个shell编程
Implement wc (work count) of Unix.Then,use your program to write a shell script to examine the content of some files and show the result in a nice format with appropriate headers.Then,sort the result based on the size of file and show the result in the screen with a nice format.
Write a shell program to examine who have logged in the system during the last day and which command(s) s/he has executed.Then,send am email to each user which contains when they have logged in and which command(s) they have executed and some other information which you like.You can get the email addresses of users from a file.
▼优质解答
答案和解析
第一个shell脚本如下(仍然有BUG,主要是分隔符的问题,解决太复杂):#! /bin/bash# my wccount=0while getopts cmlLwv optiondo case "$option" in c) opts="$opts -c" format="${format}%-10s...