Re: Bash - an odd problem using sed or awk or for

2012-12-02 Thread John Horne
On Sat, 2012-12-01 at 23:25 -0430, Patrick O'Callaghan wrote: > On Fri, 2012-11-30 at 21:37 -0700, Greg Woods wrote: > > On Thu, 2012-11-29 at 23:33 +, John Horne wrote: > > > > > (the '=' are not part of the variable) > > > abc def > > > > > > hijk > > > xyz > > > >

Re: Bash - an odd problem using sed or awk or for

2012-12-01 Thread Patrick O'Callaghan
On Fri, 2012-11-30 at 21:37 -0700, Greg Woods wrote: > On Thu, 2012-11-29 at 23:33 +, John Horne wrote: > > > (the '=' are not part of the variable) > > abc def > > > > hijk > > xyz > > > > > > So in this case what is wanted is: > > > > > > hijk > > xy

Re: Bash - an odd problem using sed or awk or for

2012-11-30 Thread Greg Woods
On Thu, 2012-11-29 at 23:33 +, 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' -- users mail

Re: Bash - an odd problem using sed or awk or for

2012-11-30 Thread inode0
On Fri, Nov 30, 2012 at 5:32 AM, John Horne wrote: > On Thu, 2012-11-29 at 18:56 -0600, inode0 wrote: > >> >> Oh, for a simple variable this should work >> >> echo "${XX/* >> >> }" >> > Hello, > > Yes, that does seem to work :-) > > Although I have to admit I'm not sure why! I'll investigate furth

Re: Bash - an odd problem using sed or awk or for

2012-11-30 Thread John Horne
On Thu, 2012-11-29 at 18:56 -0600, inode0 wrote: > > Oh, for a simple variable this should work > > echo "${XX/* > > }" > Hello, Yes, that does seem to work :-) Although I have to admit I'm not sure why! I'll investigate further :-) Many thanks, John. -- John Horne Te

Re: Bash - an odd problem using sed or awk or for

2012-11-29 Thread JD
On 11/29/2012 04:33 PM, John Horne wrote: Hello, I have a bash script in which a variable is set to one or more lines of text. What I want is to remove any lines up to and including a blank line (or alternatively to echo all the lines after the last blank line). There may be zero or more blank

Re: Bash - an odd problem using sed or awk or for

2012-11-29 Thread inode0
On Thu, Nov 29, 2012 at 6:48 PM, inode0 wrote: > On Thu, Nov 29, 2012 at 5:33 PM, John Horne wrote: >> Hello, >> >> I have a bash script in which a variable is set to one or more lines of >> text. What I want is to remove any lines up to and including a blank >> line (or alternatively to echo all

Re: Bash - an odd problem using sed or awk or for

2012-11-29 Thread inode0
On Thu, Nov 29, 2012 at 5:33 PM, John Horne wrote: > Hello, > > I have a bash script in which a variable is set to one or more lines of > text. What I want is to remove any lines up to and including a blank > line (or alternatively to echo all the lines after the last blank line). > There may be z

Re: Bash - an odd problem using sed or awk or for

2012-11-29 Thread Patrick O'Callaghan
On Thu, 2012-11-29 at 23:33 +, John Horne wrote: > Hello, > > I have a bash script in which a variable is set to one or more lines of > text. What I want is to remove any lines up to and including a blank > line (or alternatively to echo all the lines after the last blank line). > There may be

Bash - an odd problem using sed or awk or for

2012-11-29 Thread John Horne
Hello, I have a bash script in which a variable is set to one or more lines of text. What I want is to remove any lines up to and including a blank line (or alternatively to echo all the lines after the last blank line). There may be zero or more blank lines, and the blank lines need not be consec