免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1277 | 回复: 4
打印 上一主题 下一主题

请问一下,下面的语句中<<- 是干什么的 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-28 12:51 |只看该作者 |倒序浏览
请问一下,下面的语句中<<-'RUBY' 是什么意思, <<- 是干什么的,我对shell不是太了解


"${TM_RUBY:-ruby}" -r"$TM_SUPPORT_PATH/lib/web_preview.rb" <<-'RUBY'
        puts html_head(
            :window_title    => ENV['WINDOW_TITLE'],
            :page_title        => ENV['PAGE_TITLE'],
            :sub_title        => ENV['SUB_TITLE']
        )
    RUBY

论坛徽章:
8
摩羯座
日期:2014-11-26 18:59:452015亚冠之浦和红钻
日期:2015-06-23 19:10:532015亚冠之西悉尼流浪者
日期:2015-08-21 08:40:5815-16赛季CBA联赛之山东
日期:2016-01-31 18:25:0515-16赛季CBA联赛之四川
日期:2016-02-16 16:08:30程序设计版块每日发帖之星
日期:2016-06-29 06:20:002017金鸡报晓
日期:2017-01-10 15:19:5615-16赛季CBA联赛之佛山
日期:2017-02-27 20:41:19
2 [报告]
发表于 2009-04-28 13:00 |只看该作者
  1.    Here Documents
  2.        This type of redirection instructs the shell to read  input  from  the
  3.        current  source  until  a  line containing only word (with no trailing
  4.        blanks) is seen.  All of the lines read up to that point are then used
  5.        as the standard input for a command.

  6.        The format of here-documents is:

  7.               <<[-]word
  8.                       here-document
  9.               delimiter

  10.        No parameter expansion, command substitution, arithmetic expansion, or
  11.        pathname expansion is performed on word.  If any  characters  in  word
  12.        are  quoted, the delimiter is the result of quote removal on word, and
  13.        the lines in the here-document are not expanded.  If word is unquoted,
  14.        all  lines  of the here-document are subjected to parameter expansion,
  15.        command substitution, and arithmetic expansion.  In the  latter  case,
  16.        the  character  sequence  \<newline> is ignored, and \ must be used to
  17.        quote the characters \, $, and '.

  18.        If the redirection operator is <<-, then all  leading  tab  characters
  19.        are stripped from input lines and the line containing delimiter.  This
  20.        allows here-documents within shell scripts to be indented in a natural
  21.        fashion.

复制代码

论坛徽章:
5
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015年亚洲杯之朝鲜
日期:2015-03-13 22:47:33IT运维版块每日发帖之星
日期:2016-01-09 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44
3 [报告]
发表于 2009-04-28 13:13 |只看该作者
LZ, man一下啊。

论坛徽章:
0
4 [报告]
发表于 2009-04-28 14:13 |只看该作者
谢谢,我在在windows上用cygwin,没有安装文档,google上又找不到,只好来这里问了

论坛徽章:
0
5 [报告]
发表于 2009-04-28 14:23 |只看该作者
是重定向的
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP