标签: bash loops
作为标题的统计信息,我只能使在线状态显示在打印的姓氏上 我的脚本如下(变量前缀包含ID号)
for i in $prefix do name=$(grep -q $i /etc/passwd | cut -d ':' -f5) who |grep -q "$name" || test && echo "$name is Online" || echo "$name is Offline" done