#!/bin/bash #1 read -d '' sql << EOF #2 select c1, c2 from foo where c1='something' EOF echo "$sql" #6 export sql #7 bash -c 'echo $sql' #8
为什么第 6 行能正确输出多行变量,第 8 行就合并成单行了呢?