linux - awk print two variables on the same line -


i need use awk print 2 variables on same line

foo=multiline pattern bar=multiline pattern  awk -v foo="$foo" -v bar="$bar" 'begin {print foo bar}' 

this output:

foo1 foo2 foo3 bar1 bar2 bar3 

i need get

foo1 bar1 foo2 bar2 foo3 bar3 

you can use paste side-by-side output:

paste <(echo "$foo") <(echo "$bar") 

Comments

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -