LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to differ a string with a text file (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-differ-a-string-with-a-text-file-4175516642/)

Ejdaha 08-28-2014 07:22 AM

How to differ a string with a text file
 
Dear all

I have a string with 10 lines and would like to differ it with a text file. Should I read it line by line, trim and differ or is there any simple solution?

thanks beforehane

pan64 08-28-2014 07:28 AM

the tool diff is able to accept input from stdin, so:
echo $STRING | diff - textfile
can work


All times are GMT -5. The time now is 09:18 AM.