StackOverflow 文件 sh 教程 read 命令 讀取剝離前導和尾隨空格的行 讀取剝離前導和尾隨空格的行 Created: November-22, 2018 $ read -r foo <<EOF > this is a line >EOF $ printf '%s\n' "$foo" this is a line 逐字讀一行