使用here文档

一个简单的例子使用here文档:
#!/bin/sh
cat <<!FUNKY!
hello
this is a here
document
!FUNKY!
这个脚本的输出如下:
hello
this is a here
document
here脚本最常用的就是从脚本程序中输出大量的文本。可以避免使用echo来一行行的输出文本。

0 评论:

Post a Comment