commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
The same thing using only Bash built-in's.
For readability I've kept the variables out, but it could me made extremely more compact (and totally unreadable!) by stuffing everything inside the single echo command.
This line provides the same result by reading the output of a less arbitrary value.
This is a personal choice on the matter, and the result on different machines may vary.
Identical output but a different way without having to shoot with the Awk cannon :)