A script to check the USA's Homeland Security threat level

Jan 16, '04 10:33:00AM

Contributed by: pdxguy

Here's a one-line shell command to get the current threat level from the Department of Homeland Security:

alias hstl 'echo -n "Threat Level: ";'" curl -s
 http://www.dhs.gov/dhspublic/getAdvisoryCondition | 
 tail -n 1 | awk -F\"'"'" '{ print "\$2" }'"
NOTE: Enter the above as one long line with a space before http and tail; broken up here for easier readability.

Example:

macosx % hstl
Threat Level: HIGH


Tested with tcsh and 10.2.6 only.

[robg adds: Works fine in 10.3.2, too.]

Comments (25)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20031229185336725