finding files in dos format + .sql files without an empty last line

Warren Head warrenhead at gmail.com
Thu Feb 22 07:22:08 PST 2007


2007/2/22, Ag. Hatzimanikas <a.hatzim at gmail.com>:
>
> On Thu, Feb 22, at 11:01 Warren Head wrote:
> >
> > Some files however are still unix syntaxed files, but because the last
> line
> > of the file is (somehow no longer) empty, this last line is no longer
> > executed by the DBMS.
> >
>
> At a first step,to determine the reason,can you show us the output of
> a problematic file,plus a working file with:
>
> cat -A file |tail -n 2


Here goes:

$ cat -A unixfilewithfilledlastline.txt | tail -n 2
this is a unixfile$
the final line is not empty
$ cat -A unixfilewithemptylastline.txt | tail -n 2
this is a unixfile$
the final line is empty$

(The empty line right above this line is also part of the output.)
$ cat -A dosfilewithfilledlastline.txt | tail -n 2
this is a dosfile^M$
the final line is not empty
$ cat -A dosfilewithemptylastline.txt | tail -n 2
this is a dosfile^M$
the final line is empty^M$

(The empty line right above this line is also part of the output.)


> That way,I believe Warren himself can find the solution not only for
> this problem but for the others will come.
>

Sure thing.
I can see a pattern emerging, lets see what I can come up with (if you don't
beat me to it)


Cheers, Warren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/blfs-support/attachments/20070222/55904403/attachment.html>


More information about the blfs-support mailing list