Skip to content

Instantly share code, notes, and snippets.

@furushchev
Created May 28, 2014 12:52
Show Gist options
  • Save furushchev/8b6fcd40431b03dcfb7d to your computer and use it in GitHub Desktop.
Save furushchev/8b6fcd40431b03dcfb7d to your computer and use it in GitHub Desktop.
時間のかかるコマンドの後に知らせてくれるコマンド
#!/bin/bash
cat <<EOF >> ~/.bashrc
function alert(){
local SAY="say -v Otoya" # use "say -v Kyoko" if you like female
if [ \$# -ge 1 ]; then
\$@ && \$SAY "\$@ が おわったでー。"
else
\$SAY "なにすんねん!"
fi
}
EOF
exec -l $SHELL
echo "usage: bash alert_after_long_command.bash"
@furushchev
Copy link
Author

左の"Download Gist"を押してダウンロードしたら、解凍して
ターミナルから解凍先ディレクトリへ移動し、

bash alert_after_long_command.bash

と入力しよう!!!!

@furushchev
Copy link
Author

使い方

alert <長い処理>
# 例: $ alert brew doctor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment