[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] Help with sed script!



On 8/9/07, Timothy Legge <timlegge gmail com> wrote:

> sed -n '
> # print line and branch to end only for non matching lines
> /DC=LO/!{p;b}
> # remove trailing spaces
> s/ *$//
> # store the current line
> h
> # read next line destroying current line
> n
> # remove reading spaces
> s/^ *//
> # swap the current line and stored line
> x
> # append the new stored line to the current line
> G
> # remove embedded new line
> s/\n//p
> ' $2

replace the $2 with $1 my command line originally included the DC=LO string...

Tim


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]