使用命令的輸出提供 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)