Skip to content

Instantly share code, notes, and snippets.

@hinananoha
Created February 7, 2025 03:11
Show Gist options
  • Save hinananoha/910b8430ffa5d504331d96b51cd7ea45 to your computer and use it in GitHub Desktop.
Save hinananoha/910b8430ffa5d504331d96b51cd7ea45 to your computer and use it in GitHub Desktop.
無限 done do done 酒場
#!/bin/bash
function trap_sigint() {
echo -n "酒場"
echo ""
echo "$(( i / 2 )) Beer and Gyoza."
if [ $(( i % 2 )) -eq 0 ]; then
echo "帰宅成功"
else
echo "帰宅失敗"
fi
exit 1
}
trap trap_sigint sigint
i=1
while : ;do
if [ $(( i % 2 )) -eq 0 ]; then
echo -n "do "
else
echo -n "done "
fi
((i++))
sleep 0.1
done
@hinananoha
Copy link
Author

hinananoha commented Feb 7, 2025

使い方

  • bash donedodonebar.sh します
  • いいかんじのところで Ctrl+C します。
  • そこまでに飲み食いしたビールと餃子の数(done do の組み合わせ)が出ます。
  • 最後がdone で終わっていれば帰宅成功です。最後がdoで終わってたら帰宅失敗です。
  • 餃子とビールは文化です。

以上です。

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