本文已参与「新人创作礼」活动,一起开启掘金创作之路。
shell脚本echo 参数传递,for循环自增,for读取列表
`#!/bin/bash
获取所有用户
function get_users
{
users=cat /etc/passwd | tail -n+11 | cut -d: -f1 | cut -d_ -f2
echo $users
}
遍历用户列表对用户名做处理
user_list=get_users
index=1
for user in index user is : (($index+1))
done`