On Fri, Apr 16, 2010 at 01:22:24AM -0700, Radim wrote:
> 
> Hello,
> I have such script:
> 
> (ONLY THIS THREE LINES ARE THE COMMANDS )
> content=$(cat $script | sed  '/function codecs/,/fi;/d');
> content=$(echo $content | sed -n '/mandriva/,/fi;}/p');
> content=$(echo $content | sed  '/^\s*urpmi[:space:]--auto/p');
> 
> But it doesn't work as I would expected.
...
> What I try to do:
> 1) To delete the codecs function of the output.
> 2) To get the "if mandriva" block
> 3) from that block to get lines of urpmi
> 
> Anybody help?

Key insight would be 

    content=$(cat $script | sed ...)
    echo "$content" > x

Look at "x", and see what you got.  Why not just put all 3 "sed"
filters in a pipe?

-- 
William



Reply via email to