LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   read line from a file and check the string (https://www.linuxquestions.org/questions/programming-9/read-line-from-a-file-and-check-the-string-4175446121/)

rajachan 01-17-2013 11:07 PM

read line from a file and check the string
 
hi,

i am having the output in file like below. i need to validate line by line and check the string is same or not.

output file


mango
orange
apple

if first line is mango and second is orange and third is apple
then i need to give the message success

else

any one of the string is wrong then it is not success.

how can i do this in shell scripting.. please help...

bigearsbilly 01-18-2013 01:58 AM

homework eh?

look at man sort, man uniq

grail 01-18-2013 03:23 AM

Of not homework and you are actually stuck, show us what you have tried?


All times are GMT -5. The time now is 06:07 PM.