<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>munibus</author_name>
  <author_url>https://blog.hatena.ne.jp/munibus/</author_url>
  <blog_title>Muni Bus</blog_title>
  <blog_url>https://munibus.hatenablog.com/</blog_url>
  <categories>
    <anon>bash</anon>
  </categories>
  <description>パターン照合演算子%を使えばよい。以下は拡張子を1つ、2つ取り除く例。シェル変数stに拡張子を含むファイル名のような文字列を代入して試している。 $ st=a.bc.def.ghij$ echo ${st%.*}a.bc.def$ echo ${st%.*.*}a.bc パターン照合演算子%は一致する最小部分を削除した文字列を返す。一方で、パターン照合演算子%%は、一致した最長部分を削除した文字列を返す。拡張子をすべて削除したいのであれば、こちらを使うと便利。 $ st=a.bc.def.ghij$ echo ${st%%.*}a</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmunibus.hatenablog.com%2Fentry%2F2014%2F09%2F26%2F220049&quot; title=&quot;【bash】シェル変数に代入されている、パスを含むファイル名から拡張子を取り除く - Muni Bus&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>2014-09-26 22:00:49</published>
  <title>【bash】シェル変数に代入されている、パスを含むファイル名から拡張子を取り除く</title>
  <type>rich</type>
  <url>https://munibus.hatenablog.com/entry/2014/09/26/220049</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
