doglover3920 / EPGimport-Sources

GNU General Public License v3.0
15 stars 10 forks source link

Windows/Unix style line endings #9

Closed adrianmihalko closed 2 years ago

adrianmihalko commented 2 years ago

I scratched my head for a little bit why this script not worked for me, then I realised that somewhere my Unix style line endings were replaced with Windows style line endings (even when I checked Unix style in my editor - maybe at upload were converted by FTP program - I need to check this).

root@vuuno4k:/etc/epgimport# cat -ve FILTERpattern.txt 
"BBCEarth.hr">1:0:19:1C06:29:46:E080000:0:0:0:^M$
"BBCEarth.nordic">1:0:19:1C06:29:46:E080000:0:0:0:^M$
"BBCEarth.ro">1:0:19:1C06:29:46:E080000:0:0:0:^M$
"BBCEarth.svn">1:0:19:1C06:29:46:E080000:0:0:0:^M$
root@vuuno4k:/etc/epgimport# dos2unix FILTERpattern.txt 
root@vuuno4k:/etc/epgimport# cat -ve FILTERpattern.txt 
"BBCEarth.hr">1:0:19:1C06:29:46:E080000:0:0:0:$
"BBCEarth.nordic">1:0:19:1C06:29:46:E080000:0:0:0:$
"BBCEarth.ro">1:0:19:1C06:29:46:E080000:0:0:0:$
"BBCEarth.svn">1:0:19:1C06:29:46:E080000:0:0:0:$

It is sneaky because it is difficult to find this error by first view and you just get empty output from grep command.

Grep in the code relies on Unix style line endings. I would recommend to add the following line to be sure we are working with Unix style line endings. To line 17:

/usr/bin/dos2unix /etc/epgimport/FILTERpattern.txt

dos2unix is part of every installation.

Screenshot 2021-12-29 at 13 59 34
doglover3920 commented 2 years ago

Done. Although I never had an issue with it. But it cannot hurt