A problem with "grep" on a script

view story

http://www.unix.com – Hello every one, I have two files : file1 and file2 - file1 contains one column and multiple lines. - file2 contains multiple lines and multiple columns. I want to do a script that compare the first column of file2 with the only column of file1 then took the lines that are the same and search for each line the whole line on file2 then write the result on a file that we can call RESULT. Here is my script : Code: #!/bin/bash more file2|awk '{print $1}'|while read line do     grep $line file1 done|while read ligne do     grep '^$ligne' file2 done But I still do no (HowTos)