<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>coffee_kabu</author_name>
  <author_url>https://blog.hatena.ne.jp/coffee_kabu/</author_url>
  <blog_title>Bus errorとSegmentation faultに困ったら見るブログ</blog_title>
  <blog_url>https://coffee-guhaw.hateblo.jp/</blog_url>
  <categories>
    <anon>シェルコマンド/シェルスクリプト</anon>
  </categories>
  <description>(元記事 2015/10/25) あるディレクトリにあるファイルのリストに対して処理をするときはよく、 #!/bin/shfor i in `ls *.txt`do echo $idone のような書き方を使う 今回は、あるファイルに書かれた各行に対してなんらかの処理をする場合、 #!/bin/shwhile read line; do echo $linedone &lt; $data1 さらにこのファイル$data1に空行が含まれている場合、そこだけ飛ばすようにしたいときは、 #!/bin/shwhile read line; doif [ -n &quot;$line&quot; ]; then echo $li…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcoffee-guhaw.hateblo.jp%2Fentry%2F2024%2F07%2F01%2F000000&quot; title=&quot;【シェルスクリプト】ファイルを1行ずつ読み込んで処理する - Bus errorとSegmentation faultに困ったら見るブログ&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>2024-07-01 00:00:00</published>
  <title>【シェルスクリプト】ファイルを1行ずつ読み込んで処理する</title>
  <type>rich</type>
  <url>https://coffee-guhaw.hateblo.jp/entry/2024/07/01/000000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
