试编写一个脚本,显示下边的菜单: 1.Display list of all user currently logged in 2.Get help on a particular command Pressto exit 如果选择2,脚本要接受一个命令名作为输入数据.如果没有数据输入,脚本要显示错误并推出,否则,脚本调用手册并把命令名作为参数传递过去.
最佳答案
五星知识达人网友:慢性怪人
2021-12-20 03:27
echo "1:display all the users login currently"
echo "2:get help on a particular command"
echo "please you choose a num"
read num
if test $num -eq 2
then
echo "please input the command that you want to know about"
read chr
fi
case $num in
1) who;;
2) man $chr;;