Bash - an odd problem using sed or awk or for
Patrick O'Callaghan
pocallaghan at gmail.com
Sun Dec 2 03:55:42 UTC 2012
On Fri, 2012-11-30 at 21:37 -0700, Greg Woods wrote:
> On Thu, 2012-11-29 at 23:33 +0000, John Horne wrote:
>
> > ============ (the '=' are not part of the variable)
> > abc def
> >
> > hijk
> > xyz
> > ============
> >
> > So in this case what is wanted is:
> >
> > ============
> > hijk
> > xyz
> > ============
> >
> > to be shown.
>
> echo "$XX" | sed -e '1,/^$/d'
This will delete lines up to and including the first blank line. The
OP's problem statement isn't very clear, but I think he wants to delete
everything up to and including the last blank line, if any.
poc
More information about the users
mailing list