LoginSignup
5
5

More than 5 years have passed since last update.

rubyとzshを使ってランダム文字列を生成する

Posted at

kyanny さんのブログを読んで「これは便利!!」と思ったけど、インストールしたりするのはちょっとな…と思ったので、zshで関数を作って同じ様な感じで使えるようにしてみました。

.zshrc
function rand() {
    ruby -rsecurerandom -e "puts SecureRandom.$1 $2"
}
usage
$ rand hex 10
$ rand uuid
5
5
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5