禾木瞎写

关注

shell脚本格式化输出/etc/passwd文件内容

禾木瞎写

关注

阅读 77

2022-06-28

#!/bin/bash
#IFS定义分隔符(临时修改,仅对read有效).
#read定义7个变量,分别对应/etc/passwd每行数据中的7列.

while IFS=":" read user pass uid gid info home shell
do
echo -e "My UID:$uid,\tMy home:$home"
done < /etc/passwd

shell脚本格式化输出/etc/passwd文件内容_格式化输出


相关推荐

boomwu

shell脚本之格式化输出

boomwu 39 0 0

简单聊育儿

shell脚本之格式化输出对象

简单聊育儿 28 0 0

狗啃月亮_Rachel

[Shell脚本]字典、列表、JSON格式化

狗啃月亮_Rachel 67 0 0

吃面多放酱

《懒人Shell脚本》之二——语料库的格式化输出

吃面多放酱 32 0 0

魔都魅影梅杜萨

linux账户文件/etc/passwd详解

魔都魅影梅杜萨 11 0 0

非衣所思

格式化输出%:使用%%

非衣所思 157 0 0

mjjackey

python格式化输出

mjjackey 153 0 0

海滨公园

python 格式化输出

海滨公园 102 0 0

止止_8fc8

pythonxml格式化输出

止止_8fc8 161 0 0

金刚豆

go 格式化输出

金刚豆 138 0 0

精彩评论(0)

0 0 举报