<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>MillyC</author_name>
  <author_url>https://blog.hatena.ne.jp/MillyC/</author_url>
  <blog_title>Milly のメモ</blog_title>
  <blog_url>https://millyc.hatenadiary.org/</blog_url>
  <categories>
    <anon>*Programming</anon>
    <anon>Ruby</anon>
  </categories>
  <description>入力がなにも無ければヘルプ表示をしたいという場合に使える。 isinput.rb unless File.pipe?('/dev/stdin') || IO.select([ARGF], nil, nil, 0) puts 'no input' end 出力例 $ touch x $ cat x | ruby isinput.rb $ ruby isinput.rb &lt; x $ ruby isinput.rb x no input $ ruby isinput.rb y isinput.rb:1:in `to_io': No such file or directory - y (Errno:…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmillyc.hatenadiary.org%2Fentry%2F20081106%2F1225974223&quot; title=&quot;パイプかリダイレクトかファイル指定による入力が存在するかの判定 - Milly のメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-11-06 21:23:43</published>
  <title>パイプかリダイレクトかファイル指定による入力が存在するかの判定</title>
  <type>rich</type>
  <url>https://millyc.hatenadiary.org/entry/20081106/1225974223</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
