C
ccc31807
For the past two days, I've been engaged in moving a CGI application
from Windows to Linux, and boy, have I gotten an education! I would
have undertaken the project if I had know how frustrating it would be,
but I would have been a lot less enthusiastic going in.
I have spend most of my time (so far) struggling with data input to
MySQL, both schema and data. After hours of blind groping, I figured
out the intricacies of mysqlimport, LOAD DATA FILE, and mysql -e
between different versions and different OSes. Thank God for Perl --
writing simple scripts to munge the input files to read them into
MySQL was both easy and fun, and effective.
Now, I'm dealing with the differences between Perl versions, the one
on the Linux server is a lot older than the Windows server, but that's
straightforward. If something doesn't work, it's easy enough to fix by
hand -- unless someone knows of a library that translates from one
version to another.
The point of this post, other than just to blow off steam and take a
break, is to share a couple of vi tips that I discovered. These have
proven useful to me, and may to others, and besides, if I forget them
I can simply google c.l.p.m.
First, how to insert a non-printable character in a (vim) regular
expression? Let's say you want to replace form feeds (^@) with
nothing. You can see the codes for characters by giving the
command :digraphs, and then insert the character in the regular
expression by doing Cntl-k, two letter code.
Second, how to convert a simple, ASCII text file from Windows to
Linux? The problem was an unfathomable premature end of script headers
error that I was at my wit's end to fix. In vi (vim), you give the
command :set fileformat:unix, and presto, chango, the premature end of
script headers error disappears!
Yeah, I know this is OT, but I thought this might help someone else,
and I needed to do something to relax anyway.
CC.
from Windows to Linux, and boy, have I gotten an education! I would
have undertaken the project if I had know how frustrating it would be,
but I would have been a lot less enthusiastic going in.
I have spend most of my time (so far) struggling with data input to
MySQL, both schema and data. After hours of blind groping, I figured
out the intricacies of mysqlimport, LOAD DATA FILE, and mysql -e
between different versions and different OSes. Thank God for Perl --
writing simple scripts to munge the input files to read them into
MySQL was both easy and fun, and effective.
Now, I'm dealing with the differences between Perl versions, the one
on the Linux server is a lot older than the Windows server, but that's
straightforward. If something doesn't work, it's easy enough to fix by
hand -- unless someone knows of a library that translates from one
version to another.
The point of this post, other than just to blow off steam and take a
break, is to share a couple of vi tips that I discovered. These have
proven useful to me, and may to others, and besides, if I forget them
I can simply google c.l.p.m.
First, how to insert a non-printable character in a (vim) regular
expression? Let's say you want to replace form feeds (^@) with
nothing. You can see the codes for characters by giving the
command :digraphs, and then insert the character in the regular
expression by doing Cntl-k, two letter code.
Second, how to convert a simple, ASCII text file from Windows to
Linux? The problem was an unfathomable premature end of script headers
error that I was at my wit's end to fix. In vi (vim), you give the
command :set fileformat:unix, and presto, chango, the premature end of
script headers error disappears!
Yeah, I know this is OT, but I thought this might help someone else,
and I needed to do something to relax anyway.
CC.