使用命令的输出提供 while 循环
这为 while
循环提供了 grep
命令的输出:
while IFS=":" read -r user _
do
# "$user" holds the username in /etc/passwd
done < <(grep "hello" /etc/passwd)
这为 while
循环提供了 grep
命令的输出:
while IFS=":" read -r user _
do
# "$user" holds the username in /etc/passwd
done < <(grep "hello" /etc/passwd)