2006年11月26日のブックマーク (2件)

  • 技術メモ帳: [unix]複数のファイルの名前をまとめて変更する

    複数のファイルの名前を変更する際に、 便利なコマンドというものがある。 いくつかご紹介させていただこう。 カレントディレクトリにあるファイルの名前を、 たとえば、*.html を *.htm と名前を変更するという課題に対し どのぐらいエレガントに書けるかというのを比較してみる。 まず、普通にやったらどうだろう。 おそらく、for文 をつかうことだろう。 for file in *.html do base=`basename $file .html` mv $base.html $base.htm; done; zshだともうちょっとスマートにかけて、 for file in *.html do mv $file:r.html $file:r.html; done; こんな具合。 for文 が嫌いなネット右翼のために、 xargs を使ってこの問題を解いてみよう。 ls -1 *.htm

    Gimite
    Gimite 2006/11/26
    ファイル名の一括リネーム
  • RMagick

    Thumbnails are just the start! Check out the RMagick portfolio. The first page shows some basic transformations. Page 2 demonstrates special effects. Page 3 illustrates the drawing API. There are two versions of RMagick, RMagick 1 and RMagick 2. Most people will want to install RMagick 2. This version works with Ruby 1.8.2 and later (including Ruby 1.9) and ImageMagick 6.3.0 and later. All new enh

    Gimite
    Gimite 2006/11/26
    グラフィックライブラリ