mysql -u $USER -p${PASSWORD} $DATABASE << EOF >/tmp/dd-$$ 2>/tmp/ddd-$$
select *
from $TABLE;
EOF
cat /tmp/dd-$$ |sed '1d'
执行此test.shell报如下错:
warning: here-document at line 17 delimited by end-of-file (wanted `EOF')
原因是末尾的EOF后面带有空格,EOF前后都不应有空格或其他符号