logo
  • 教程列表
  • SO官方文檔
  • 流程替代
    • 比較網路上的兩個檔案
    • 使用命令的輸出提供 while 迴圈
    • 連線檔案
    • 用 paste 命令
    • 一次通過多個程式流式傳輸檔案
    • 避免使用子 shell
  1. StackOverflow 文件
  2. Bash 教程
  3. 流程替代
  4. 使用命令的輸出提供 while 迴圈

使用命令的輸出提供 while 迴圈

Created: November-22, 2018

這為 while 迴圈提供了 grep 命令的輸出:

while IFS=":" read -r user _
do
    # "$user" holds the username in /etc/passwd
done < <(grep "hello" /etc/passwd)
  • 連線檔案
  • 比較網路上的兩個檔案

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明