On Feb 11, 2005, at 12:24 PM, Dick, Brian E. wrote:

...there has to be a better way to do this.

I have a file that contains lines like the following.

src1 trg1
src2
src3 trg3

I need to parse the file and send the two values in each line to another
program. When there is only one value on the line, I have to send the
value twice. Here's the target I wrote to parse the file. I looks pretty
ugly. Can anyone simplify this?

Yeah, I can simplify it to one line of shell:

        sed -e 's/^\([^ ]*\)$/\1 \1/' < the-file | another-program

HTH,
—mark—


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to