Re: Missing EOF
From: Andreas Kahari (ak+usenet_at_freeshell.org)
Date: 09/17/03
- Next message: mhk: "test condition in unix"
- Previous message: Mark Blain: "Re: Unix (shell) scripts cookbook or compilation wanted"
- In reply to: Kornilios Kourtis: "Re: Missing EOF"
- Next in thread: Brian Key: "Re: Missing EOF"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 17 Sep 2003 21:42:44 +0000 (UTC)
In article <bkaipn$a7j$1@ulysses.noc.ntua.gr>, Kornilios Kourtis wrote:
> Vaslav <vaslav@globlar.cz> wrote:
>> Some files I must process have a EOF and some files don't. I know I can
>> add one with echo "" >> file. The problem is that I can't use files with
>> 2 EOF. Should I use tr ? How?
>>
>
> AFAIK files don't really contain an EOF at their end. It's just a symbol
> used in programming to allow the programmer to know that a file
> ended.
I believe he's really asking for a way of adding a final newline
if the last line in the file doesn't end with one.
However, a file with a line not ending with a newline is
strictly speaking not a text file. Unix utilties for
manipulating text files are generally bad att coping with
non-text files.
Some editors (vi/vim and Emacs) can be made to add a final
newline to files when saving them if one wasn't present before.
If this feature may be used in an automatic fashion (maybe by
scripting ex/vi), I don't know.
-- Andreas Kähäri
- Next message: mhk: "test condition in unix"
- Previous message: Mark Blain: "Re: Unix (shell) scripts cookbook or compilation wanted"
- In reply to: Kornilios Kourtis: "Re: Missing EOF"
- Next in thread: Brian Key: "Re: Missing EOF"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|