How can I remove the few lines from a multi-lined variable?
I'm getting this sort of stuff back from Expect and need to neaten it up a little bit
$var='
total 20
drwxr-xr-x 5 drew.jess users 4096 2013-01-22 15:51 bash
drwxr-xr-x 2 drew.jess users 4096 2011-11-11 10:37 diff
drwxr-xr-x 8 drew.jess users 4096 2012-02-14 09:09 expect
drwxr-xr-x 3 drew.jess users 4096 2011-10-06 11:05 perl
drwxr-xr-x 3 drew.jess users 4096 2013-02-07 13:10 python
drew ~ $
';
Those blank lines are representative of what I have. Ideally, I want to make $var look like this:
$var='
total 20
drwxr-xr-x 5 drew.jess users 4096 2013-01-22 15:51 bash
drwxr-xr-x 2 drew.jess users 4096 2011-11-11 10:37 diff
drwxr-xr-x 8 drew.jess users 4096 2012-02-14 09:09 expect
drwxr-xr-x 3 drew.jess users 4096 2011-10-06 11:05 perl
drwxr-xr-x 3 drew.jess users 4096 2013-02-07 13:10 python
';
I should clarify; the important part of this question to me is the removal of the following line:
drew ~ $
The whitespace, I think I can cope with.