for item in `cat 2.txt` do grep $item 1.txt >/tmp/test.txt if [ $? -ne 0 ];then echo "$item" fi done