andrewsomething@ubuntu:~$

Just another Ubuntu weblog

Posts Tagged ‘bashrc

Wading upstream

with 3 comments

So I want to start making an effort to share more of the little tips, tricks, and scripts that I use in the course of Ubuntu development. Hopefully someone will find this stuff useful. On the other hand, I also hope someone will come along, look at what I use, and point out just how wrong it is and show me something simpler.

Potomac Wayside Falls Upstream

To start off with, here’s a function from my ~/.bashrc file. Gmail has an unfortunate insistence on forcing line breaks. This can be an issue when working with the Debian BTS as you need to interact with the control server through one line commands sent via email. The place where this is always the most painful for me has been in marking bugs as forwarded upstream. So I figured I’d make my life easier by just doing it on the command line:

function bts-forward () {
    if [[ "$1" == ${1//[^0-9]/} && "$2" == http* ]]; then
        echo "forwarded $1 $2" | \
        sendmail -f"$DEBEMAIL" control@bugs.debian.org;
    else
        echo "Usage: bts-forward DEBIAN_BUG UPSTREAM_URL"
    fi
    }

Written by andrewsomething

November 12, 2011 at 4:08 pm

Posted in Ubuntu

Tagged with , , ,