<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>iww</author_name>
  <author_url>https://blog.hatena.ne.jp/iww/</author_url>
  <blog_title>揮発性のメモ２</blog_title>
  <blog_url>https://iww.hateblo.jp/</blog_url>
  <categories>
    <anon>Linux</anon>
    <anon>bash</anon>
  </categories>
  <description>for文で出来る for x in A=hoge B=piyo; do eval $x done echo A=$A echo B=$B A=hogeA B=hogeBwhile文でこう書くとアウト echo -e &quot;A=hoge\nB=piyo&quot; | while read x; do eval $x done A= B=なぜなら、パイプを使っているから。 サブシェルになるので変数はどっか行ってしまうwhile文でやりたいときは、どうにかパイプを使わずに直接食わせれば良い while read x; do eval $x done &lt; &lt;(echo -e &quot;A=hoge\nB=piyo&quot;) w…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fiww.hateblo.jp%2Fentry%2F2021%2F03%2F24%2F111612&quot; title=&quot; bashで whileの中でevalを使う - 揮発性のメモ２&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>https://cdn.user.blog.st-hatena.com/default_entry_og_image/42132/1577169589465165</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-03-24 11:16:12</published>
  <title> bashで whileの中でevalを使う</title>
  <type>rich</type>
  <url>https://iww.hateblo.jp/entry/2021/03/24/111612</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
