<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hogashi</author_name>
  <author_url>https://blog.hatena.ne.jp/hogashi/</author_url>
  <blog_title>hogashi.*</blog_title>
  <blog_url>https://blog.hog.as/</blog_url>
  <categories>
    <anon>シェル</anon>
    <anon>落書き</anon>
  </categories>
  <description>shuf コマンドとは、入力の行をシャッフルして出力するコマンド。 shuf invocation (GNU Coreutils 9.5) 手元の環境に入ってなかったので、こういうのを書いてみた。 Bash で試しています。オプションとかは実装してません。 function shuf() { OLD_IFS=$IFS IFS=$'\n' ( for line in $( if [ -n &quot;$1&quot; ]; then cat &quot;$1&quot; else cat /dev/stdin fi ); do echo &quot;$RANDOM&quot;$'\t'&quot;$line&quot; done ) | sort -n | cut -f2-…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.hog.as%2Fentry%2F2024%2F10%2F04%2F155243&quot; title=&quot;shufコマンドがないときに同じことをするシェルスクリプト - hogashi.*&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>2024-10-04 15:52:43</published>
  <title>shufコマンドがないときに同じことをするシェルスクリプト</title>
  <type>rich</type>
  <url>https://blog.hog.as/entry/2024/10/04/155243</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
