首页 > 系统服务 > 详细

Linux_simpl shell-利用Shell脚本for循环输出系统中的用户及其Shell

时间:2020-02-18 13:43:02      阅读:49      评论:0      收藏:0      [点我收藏+]
[root@localhost ~]# vim user.sh 
  1 #!/bin/bash
  2 for i in `cut -d ":" -f1 /etc/passwd`;
  3 do
  4 echo -e "Hello User:" "\033[31m$i\033[0m"  "shell is" "\033[33
    m`grep $i /etc/passwd|cut -d ":" -f7`\033[0m""."
  5 done
技术分享图片

 

 

Linux_simpl shell-利用Shell脚本for循环输出系统中的用户及其Shell

原文:https://www.cnblogs.com/DevonL/p/12325821.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!