<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>uvb_76</author_name>
  <author_url>https://blog.hatena.ne.jp/uvb_76/</author_url>
  <blog_title>Re: 醤油の一升瓶じゃあ戦えない</blog_title>
  <blog_url>https://uvb-76.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>特定のコマンドを実行した結果をコミットしたいときにコミットメッセージにそのコマンドが記載されていると、あとから見返す時に便利。ただその実行したコマンドをコピーするのにhistoryで履歴呼び出してから先頭に echo つけてパイプ挟んで pbcopy して〜という作業がだるかったのでコマンド一発で終わらせたくて書いた。 sed 使うのがシンプルっぽい。 history | sed -n 1p | pbcopy fishのhistoryは1行目の方が新しいので1行目だけ出力されたい。なので 1p で1行目を出力する。ただ、そのままだとsedがパイプで受け取った入力を全部垂れ流すので -n で抑制…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fuvb-76.hatenablog.com%2Fentry%2F2022%2F02%2F18%2F060812&quot; title=&quot;fishで直前に実行したコマンドをコピーする - Re: 醤油の一升瓶じゃあ戦えない&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>2022-02-18 06:08:12</published>
  <title>fishで直前に実行したコマンドをコピーする</title>
  <type>rich</type>
  <url>https://uvb-76.hatenablog.com/entry/2022/02/18/060812</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
