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

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -