Archive for the 'Programming' Category

The Awakeness of Shell Scripting with AWK

I guess I’m getting too used to the “it’s been a while!” thingy so, awkward title aside, let’s just move straight to today’s post:

The more I learn about AWK, the more I love it. It’s just that simple. I’ve been trying its powers a bit and came with an awk-mazing (and probably useless, but still exciting) five-lines (sans comments) cute script that emulates the most popular feature (the “-e” option) of our good ol’ boy apropos.
Enter lazyman!

#!/bin/bash
#
# lazyman.sh - displays the name section of some program’s man
# page.
#
# DESCRIPTION
# this tiny script shows the NAME section of a given program’s
# manual page, displaying an output quite similar to
# “apropos -e” but directly calling “man” instead of querying
# against “mandb”.
#
params=$(echo $@ | awk 'END{print NF}')
case $params in
1) man $1 | awk '/NAME/{getline;print}' ;;
*) echo "usage: lazyman.sh [program]" ;;
esac

That’s all folks! I hope you’ve enjoyed it and thanks for reading!

UNIX Programming: Simple Notifications With mailx

Hey there! I know it’s been a month since my last post, I’m sorry about that but I’ve been pretty busy this days, having a lot to do at work and also being a full time student, so anyway, this time I’m sharing with you a nifty tip regarding notifications using mailx on UNIX, so without further ado, here’s the actual code:

#!/bin/ksh
#
# mailx settings:
#
to="someone@somewhere.com"
subject="[Notification] Something happened."
body="Lorem ipsum dolor sit amet et cétera."
#
# run and notify:
#
runSomething && (echo $body | mailx -s "$subject" "$to")

I hope you find it interesting, thanks much for reading and don’t hesitate to leave a comment!

Solaris Express Developer Edition Pushes Innovation

OpenSolaris.org

Solaris Express Developer Edition (SXDE) is a freely available release of Sun’s next generation Solaris Operating System built from the source code repository at OpenSolaris.org. The release includes the latest tools, technologies, and platforms to create applications for the Solaris OS, Java Application Platforms, and Web 2.0.

Learn More »

Getting Started with Grails

Grails is an open-source, rapid web application development framework that provides a super-productive full-stack programming model based on the Groovy scripting language and built on top of Spring, Hibernate, and other standard Java frameworks.

Getting Started with Grails

Jason Rudolph is an Application Architect at Railinc, where he develops software that helps keep trains moving efficiently throughout North America.

The book can be downloaded for free (registration required), but also you could always purchase the printed copy.

Next Page »