horrible, ugly, bad BASH string operations...

I do and do not recommend learning this.

Advanced BASH Programming - String Operations

They certainly can come in handy though if you don't want to do some basic grep/awk work.

little example:

$ foo="my words" $ echo ${foo#my} words $ echo ${foo:1} y words $ echo ${foo:2} words $ echo ${foo:3} words $ echo ${foo:4} ords $ echo ${foo:1:2} y $ echo ${foo:1:3} y w $ echo ${foo:1:4} y wo $ echo ${foo:1:5} y wor $ echo ${foo:1:6} y word $ echo ${foo:2:6} words $ echo ${foo:3:6}