StackOverflow 文档 sh 教程 read 命令 读取剥离前导和尾随空格的行 读取剥离前导和尾随空格的行 Created: November-22, 2018 $ read -r foo <<EOF > this is a line >EOF $ printf '%s\n' "$foo" this is a line 逐字读一行