9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ズンドコキヨシ with {k,ba,z}sh and sed

Last updated at Posted at 2016-03-12

ズンドコキヨシまとめ - Qiita
http://qiita.com/shunsugai@github/items/971a15461de29563bf90

なるほど。

#!/bin/bash
# or
#!/bin/ksh
z=ズン;d=ドコ;k=($z $d);while :;do echo ${k[RANDOM%2]};done|sed "H;5,\${x;s/\n//g;/^\($z\)\{4\}$d$/{x;s/$/\nキ・ヨ・シ!/;q};s/..//;x}"

zsh は以下を足してね。

[[ -n ${ZSH_VERSION-} ]] && set -o KSH_ARRAYS

もしくはこう書き変える。

z=ズン;d=ドコ;k=($z $d $z);while :;do echo ${k[RANDOM%2+1]};done|sed "H;5,\${x;s/\n//g;/^\($z\)\{4\}$d$/{x;s/$/\nキ・ヨ・シ!/;q};s/..//;x}"

Blog のほうがビルドできないので初めて Qiita で書いてみた。
https://fumiyas.github.io/

9
8
0

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
9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?