<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ike-dai</author_name>
  <author_url>https://blog.hatena.ne.jp/ike-dai/</author_url>
  <blog_title>ike-dai's blog</blog_title>
  <blog_url>https://ike-dai.hatenablog.com/</blog_url>
  <categories>
    <anon>Linux</anon>
  </categories>
  <description>exprが意外といろいろ使えることを知ったのでメモしときます。今まで、シェルスクリプト内でインクリメント演算とかするのにexprコマンドをよく使っていました。 こんな感じ。 count=0 count=`expr $count + 1` echo $count 出力結果→1 実は計算以外にもいろいろ使えることを知りました。 expr substr 文字列 開始位置 何文字分か指定 これで文字列から特定の位置を抽出できる。 例: コマンド→expr substr &quot;test&quot; 2 2 出力結果→es expr length 文字列 文字列の長さを出力 例: コマンド→expr length &quot;t…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fike-dai.hatenablog.com%2Fentry%2F20101025%2F1288000159&quot; title=&quot;シェルスクリプトで文字列操作(exprコマンド) - ike-dai&amp;#39;s blog&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>2010-10-25 18:49:19</published>
  <title>シェルスクリプトで文字列操作(exprコマンド)</title>
  <type>rich</type>
  <url>https://ike-dai.hatenablog.com/entry/20101025/1288000159</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
