![「[Mac]Automator等のシェルスクリプトでタイムアウトさせるgtimeout」のアイキャッチ画像](/images/tmb/mac-gtimeout.jpg)
Automatorでシェルスクリプトをタイムアウトさせたくて、調べてみたらHomebrewでパッケージを追加する必要があったのでメモ。
{{
## Coreutilsを追加して、gtimeout
### [Homebrew](https://brew.sh/index_ja) インストール (一応
“`shell
/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)”
“`
### Coreutils インストール
“`sh
brew install coreutils
“`
### 使い方
“`shell
gtimeout 秒数 コマンド
“`
***
しっかり10秒で止まってる。
“`shell
gtimeout 10 ping google.com
“`
