永发信息网

linux操作系统习题(求答案)

答案:1  悬赏:30  手机版
解决时间 2021-12-20 18:15
  • 提问者网友:疯子也有疯子的情调
  • 2021-12-20 02:31
试编写一个脚本,显示下边的菜单:
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;;

esac
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯