My lot in life is working with Unix and DOS based systems at the same time,
and this sort of problem is extremely common. Some text editors are noticed
for their ability to tag on control characters, my particularly nasty one is
^M for carriage returns. If you hit one of these control characters before
the finish, it can send the system into fits, I believe ^X is the EOF flag,
but someone will correct me.
My common method of fixing it is to erase the file if it's small, and use VI
to recreate it. It's the only one I can be absolutely sure of fixing it.
Editing it doesn't usually work.
Oh, and FTP'ing using ASCII rather than binary can do the same job,
especially if you're crossing platforms.
----- Original Message -----
From: John Aldrich <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 03, 1999 12:40 PM
Subject: [newbie] slocate
Hey....I had an error with a built-in cron job a few days ago and
someone told me I had an extra carriage-return in there, so I nuked
it. Now it tells me "unexpected end of file." (below is the EXACT
quote...):
>From root Thu Sep 2 04:02:07 1999
Return-Path: <root>
Received: (from root@localhost)
by slave1.chattanooga.net (8.9.3/8.9.3) id EAA11373
for root; Thu, 2 Sep 1999 04:02:03 -0400
Date: Thu, 2 Sep 1999 04:02:03 -0400
Message-Id: <[EMAIL PROTECTED]>
From: [EMAIL PROTECTED] (Cron Daemon)
To: [EMAIL PROTECTED]
Subject: Cron <root@slave1> run-parts /etc/cron.daily
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <HOME=/>
X-Cron-Env: <LOGNAME=root>
/etc/cron.daily/slocate.cron: line 6: syntax error: unexpected end of file
/etc/cron.daily/slocate.cron~: line 6: syntax error: unexpected end of file
>From root Fri Sep 3 04:02:08 1999
Return-Path: <root>
Received: (from root@localhost)
by slave1.chattanooga.net (8.9.3/8.9.3) id EAA12039
for root; Fri, 3 Sep 1999 04:02:04 -0400
Date: Fri, 3 Sep 1999 04:02:04 -0400
Message-Id: <[EMAIL PROTECTED]>
From: [EMAIL PROTECTED] (Cron Daemon)
To: [EMAIL PROTECTED]
Subject: Cron <root@slave1> run-parts /etc/cron.daily
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <HOME=/>
X-Cron-Env: <LOGNAME=root>
/etc/cron.daily/slocate.cron: line 6: syntax error: unexpected end of file
/etc/cron.daily/slocate.cron~: line 6: syntax error: unexpected end of file
==========
Here's the cron job:
#!/bin/sh
[ -e /usr/bin/updatedb ] && { sh /usr/bin/updatedb } || {
/usr/bin/slocate -u -e /tmp -e "/var/tmp,/usr/tmp,/afs,/net,/proc"
}
============
What's the problem with this??? Why does it say unexpected end of
file?
Thanks...
John