The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 07-30-2008
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,361
Quote:
Originally Posted by marcpascual View Post
Thanks, I need to re-qualify my question:

what if its not a number and you can't do math on it?

e.g.
list1:
mary
eve
delilah

list2:
joseph
adam
samson

output:
mary joseph
adam eve
samson delilah


for i in `cat list1`; ... for j in `cat list2`; ... do ... print $i $j ... done

any way around this?
Code:
set -f
IFS='
'
set -- $( cat list2 )
for i in `cat list1`
do
  printf "%s %s\n" "$i" "$1"
  shift
done