Link to home
Start Free TrialLog in
Avatar of geermu
geermu

asked on

paste two outputs without using temp files

Current code
cmd1 > output1; cmd2 > output2; paste output1 output2 > output
rm output1 output2

Is it possibe to complish same thing without introducing the intermiate files.

Thanks.
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

cmd1 > output1
cmd2 >> output1
ASKER CERTIFIED SOLUTION
Avatar of kevin_u
kevin_u
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of geermu
geermu

ASKER

one intermediate is better than 2.
I will accpet (or partially accept) it, unless some other better solution
Thanks lot.
are you stuck with a shell script?  Do you have perl?  It would take a few lines of perl to do something similar with no intermediate files.
Avatar of geermu

ASKER

Not much experienc with perl.
awk may be possible?
You should be able to do

(cmd1;cmd2) | paste - - >output
Ignore my last comment, the order is not want you want. kevinu's solution is the closest you can get.

I don't belive awk can do it.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of geermu

ASKER

Thanks. I splited the points