s="EnlighterJSRAW">#!/bin/bash

function mytest()
{
    while read line
    do
        echo $line
    done
} &lt;&lt;EOF
hello
coolshell.cn
EOF
mytest</pre>
<p>下面是其运行结果：</p>
<pre data-enlighter-language="bash" class="EnlighterJSRAW">$ bash mytest.sh
hello
coolshell.cn</pre>
<p>(全文完)</p>
<div style="margin-top: 15px; font-size: 16px;color: #cc0000;">
<p align="center"><strong>（转载本站文章请注明作者和出处 <a href="https://coolshell.cn/">�