sed'ing out newlines
Dan Barrett
nullpointer at pobox.com
Mon Dec 15 14:42:18 EST 2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 15 December 2003 12:56, nmeyers at javalinux.net wrote:
> Is that all you want to do, or are you doing something else in your sed
> script? I ask because I think it'll be expensive and slow (I haven't
> used sed in awhile, but I think you'll end up having to load the entire
> file into its memory). The "tr" utility can remove newlines much more
> efficiently:
I'm trying to assemble a CLASSPATH variable by reading in a file and
substituting out the newlines in favor of a colon and perhaps another
variable.
In essence, I've just inherited a bunch of projects with sprawling directory
structures (esp. third-party JARs scattered all over the place). I want to
be able to switch the value of CLASSPATH on the fly when moving from project
to project, so I thought one way to do it would be to have a file for each
project. Each file would list directories or individual JARs to be included
in the CLASSPATH; hence when trying out different third-party components I
could just edit the relevant file.
Does this sound rational, or have I entered molehill -> mountain territory?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/3g6asIjNiQTGkXARAsqMAKCJ4YZPZsB9liSUIEdcLl0rb9TbKwCguoSB
gLOXDopoGARBouqS5hlCz9o=
=BgiD
-----END PGP SIGNATURE-----
More information about the Discuss
mailing list