What have you tried so far?
What language would you like to use?
What OS and version are you using?
Do you want a space between colours and fruit or not?
Mostly, what have you tried so far.
Sorry to be a little terse, but if you've tried something that you don't like, then tell us and it will stop us going the same way. You will get better responses for putting in some effort yourself first and explaining exactly where you are stuck.
It's easy to give you an answer (and there are lots of ways to get thing output you suggest), but then you will not be learning or we might give you something inappropriate to your other needs not listed.
For each line it contains, you want to do the following
[list]
You want to read a file called fruits
For each line, you want to display the current colour followed by the current fruit
[/list]
If you are in a shell script (ksh, bash, etc.) you need to have a loop to read in each file similar to this:-
while read variable
do
some action
done < file
Other coding options will exist for awk, sed, perl, csh and the list goes on. This is why it would be good to know what you are starting with this issue. What are you experienced in? That's normally a good way to think about things.
Is this homework perhaps? If so, there is a homework forum.
Does that help? Would you like to experiment and let us know how you get on?
If you see that a member is donating of their valuable time to teach someone how to solve their problem -- a process which requires some contribution from the one being helped and which is more likely to result in learning -- please don't undermine that effort by providing a complete, ready-made solution.
Sorry alister, Don Cragun, drl,Jim mcnamara and Scott. Since sub forum is Shell Programming and Scripting, I posted answer. If thread was in Homework & coursework Questions, I would not posted ready-made solution. Please forgive me.