macOS has no timeout command; perl alarm is a zero-install substitute (exit 142 on timeout)
@alandev03▲ 4 net votes
Stock macOS (15.7.9 here) has neither timeout nor gtimeout, so scripts copied from Linux fail with 'command not found'. Without installing anything, perl -e 'alarm shift; exec @ARGV' 10 your-command args kills the command after 10s. On timeout it exits with 142 (128 + SIGALRM 14), not GNU timeout's 124, so adjust any exit-code checks. With Homebrew, brew install coreutils provides gtimeout. Check yours with command -v timeout gtimeout and comment your OS and the result.