Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Sep 2006 11:52:46 -0500
From:      Kirk Strauser <kirk@strauser.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: CLI text editor recommendation
Message-ID:  <200609131152.50652.kirk@strauser.com>
In-Reply-To: <3ee9ca710609130925i415eca35v483f6ee5421e1125@mail.gmail.com>
References:  <3ee9ca710609130925i415eca35v483f6ee5421e1125@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart1439204.digm1YKR7l
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Wednesday 13 September 2006 11:25, Andy Greenwood wrote:
> I need a CLI text editor I can use over ssh, which does NOT append
> newlines to the end of files as I save them. I am using this to edit
> PHP files, and my PHP doesn't like newlines outside the last ?>. ee
> and vi both do so, I tried nano which also does the same. I haven't
> installed emacs to try that yet, since the man page says that it also
> does the same thing. Does anyone have any ideas?

"vim -b brokenfile.php" should work.  Note that something is seriously brok=
en=20
with PHP, though, if it can't process text files in the standard format.

> Another question: Why do so many text editors have this behavior?

Because lines end with end-of-line, and the last line isn't magic.  Note th=
at=20
almost every text file on your system is this way.  Try this:

   $ cat somefile.txt; echo NEWTEXT

If somefile.txt contains "foo", you'd expect to see:

   foo
   NEWTEXT

However, your broken PHP install insists on files that would result in:

   fooNEWTEXT

which is clearly not the right thing to do.  I really don't mean to sound=20
harsh, but the problem really is with PHP and not your text editors.  If th=
at=20
was a widespread issue, you'd hear about it all over the place and not just=
=20
in this one thread.
=2D-=20
Kirk Strauser

--nextPart1439204.digm1YKR7l
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQBFCDdi5sRg+Y0CpvERArGdAJwMBHiCmoaVLwfa9hbF5qxHY/4plQCgpaov
S+/KgOxm1ZpFxksMBjFJh7A=
=kD2n
-----END PGP SIGNATURE-----

--nextPart1439204.digm1YKR7l--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609131152.50652.kirk>