意識の高いLISPマシン

藤原惟/すかいゆき(@sky_y)の技術用ブログ

Macでsayコマンド使おうとしてハマった

zsh + oh-my-zshの環境でsayコマンドを使おうとしたら、こうなりました。

$ say -v Alex 'Hi'
say:1: bad option: -v

原因は、oh-my-zshperlプラグインでした。

$ grep -r 'say' .oh-my-zsh/*
(中略)
.oh-my-zsh/plugins/perl/perl.plugin.zsh:# say - append a newline to 'print'
.oh-my-zsh/plugins/perl/perl.plugin.zsh:say() {
.oh-my-zsh/themes/humza.zsh-theme:      # should it say b, kb, Mb, or Gb

$ vim .oh-my-zsh/plugins/perl/perl.plugin.zsh
(60行目あたり)
# say - append a newline to 'print'
say() {
    print "$1\n"
}

こいつか! perlプラグインを外してもよかったのですが、直接コメントアウトして、ようやく本来のsayコマンドを使えるようになりました。