标签:passwd 解释 shel lin shell脚本 cat code ++ func
#! /bin/bash
__Author__=‘liy‘
function lines()
{
for line in $(cat /etc/passwd)
do
OLDIFS=$IFS
IFS=":"
count=0
for item in ${line}
do
[ ${count} -eq 0 ] && user=${item}
[ ${count} -eq 6 ] && shell=${item}
let count++
done
IFS=${OLDIFS}
echo "${user}: ${shell}"
done
}
lines
标签:passwd 解释 shel lin shell脚本 cat code ++ func
原文地址:https://www.cnblogs.com/liy36/p/12895028.html