Tuesday, February 15, 2011

nice scripting V!

tag()
{
    awk -v TAG=$1 '{printf "%-15s %s\n",TAG,$0}'
}
(
    if [ -f $SUSERELEASE ]; then
        cat $SUSERELEASE
    else
        echo "na (not SUSE Linux )"
    fi
    ) | tag 'SUSERelease'

Labels: , , ,

0 Comments:

Post a Comment

<< Home