<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kabegiwakun</author_name>
  <author_url>https://blog.hatena.ne.jp/kabegiwakun/</author_url>
  <blog_title>かべぎわブログ</blog_title>
  <blog_url>https://www.kabegiwablog.com/</blog_url>
  <categories>
    <anon>シェルスクリプト</anon>
  </categories>
  <description>概要 awk '{print $1}'とかやる$1の部分を変数で指定したい。 やりかた awk -vのあとに変数=値で指定してあげる。 $ echo &quot;AAA BBB CCC&quot; | awk -v &quot;wawawa=3&quot; '{print $wawawa}' CCC シェルスクリプト内で宣言した変数を入れることも可能。 #!/bin/bash hennsuu=3 echo &quot;AAA BBB CCC&quot; | awk -v &quot;wawawa=${hennsuu}&quot; '{print $wawawa}'CCC おわりに べんり 「シェル芸」に効く！AWK処方箋作者: 斉藤博文出版社/メーカー: 翔泳社発売日: …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.kabegiwablog.com%2Fentry%2F2018%2F07%2F26%2F120000&quot; title=&quot;awkのフィールド指定のところを変数で指定する - かべぎわブログ&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-ak.f.st-hatena.com/images/fotolife/k/kabegiwakun/20180321/20180321093102.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-07-26 12:00:00</published>
  <title>awkのフィールド指定のところを変数で指定する</title>
  <type>rich</type>
  <url>https://www.kabegiwablog.com/entry/2018/07/26/120000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
