Friday, April 22, 2011

I Could Get Addicted To Linux Again

I was trying to get a Linux script written today at work that to be honest, I should not even need to be writing.  I'll leave out the gory details, but previous people who no longer work there have left us a development environment that would have been perfectly acceptable in about 1975, and even somewhat excusable in 1985.  (I was working in the industry both years, so I know of what I speak.)  Today?  Not even slightly.

Anyway, the script that I was writing was really not that complicated, but using vi (or vile, as it is properly known) makes me rapidly lose interest in doing anything, and I am not having any luck installing any of the minimal sets of emacs on the Linux boxes we use.  (A good friend provided me the microEmacs source that he uses, but whatever variant of Linux we have at work does not have the term.h file defined--which I thought was about as vanilla as you could get when it comes to Unix/Linux variants.)  Aggravating matters, I am using telnet to connect up, and it is astonishing how slowly everything seems to work that way.  

I could put in a request to have our operations sorts install emacs there, but it would probably take a year or more for it to happen.  You know the way that Dilbert parodies the security paranoia of Dilbert's corporate IT sorts?  It is perilously close to being that way--although admittedly, we are running a prison system, so a fair bit of paranoia is probably appropriate.

Anyway, I mentioned a few days ago that I was replacing the soon to be dead hard disk on my older notebook so that I could run Windows and Ubuntu Linux dual boot.  (The soon to be dead hard disk is now a 20 GB portable USB drive.)  This is a pretty obsolete notebook--a Compaq NC6000 that HP gave me in 2007 when they upgraded my work notebook.  Yet Ubuntu Linux, in Terminal mode, using emacs, runs like a bat out of hell!  I was able to recreate the script in about ten minutes that took me at least an hour to do at work.  Some of this is because I had to remember how to write csh scripts again, and remember how to use sed to extract just some of the information out of wc -l, but also, Unix/Linux is still a spectacular development environment for basic software development, once you get vile out of the way.

Of course, I am blogging from the Linux box!

12 comments:

  1. I haven't run anything but Linux ever since Vista was released. :-)

    ReplyDelete
  2. The bloatware that is Windows does suffer in comparison when you put a good Linux desktop on the hardware that was previously Windows.

    I had a box (800mhz Celeron processor) that had started out with Windows Me, upgraded to XP and was barely wheezing along with the fully patched XP. It no longer had a purpose so I put a couple of different Linux distros on it for screwing around and was astonished to find it was a useable box.

    ReplyDelete
  3. I'm wondering why anyone in their right mind would right a script in csh.

    ReplyDelete
  4. If they are so security minded, why do they allow telnet access?

    ReplyDelete
  5. The telnet access is only within the building.

    Writing shell scripts for small things makes perfect sense. For big things, not so much. When I started at HP, I was given a 6000+ line ksh script to maintain. One of the things I did was refactor into several scripts, each of which was still too big.

    ReplyDelete
  6. I wasn't wondering about scripting - it has its place - but about using csh in particular.

    http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

    ReplyDelete
  7. If you want to have the productivity tools on your Windows box, I suggest using Cygwin for these kinds of tasks. I work almost exclusively on Linux boxes, but I connect to them from Windows using an X-client (I actually like that setup since I can disconnect my X session, then reconnect to the same exact session at home from the VPN so I can get to my work exactly as I left it). For quick work on my things on my Windows machine like massaging raw data you can't beat *nix tools so Cygwin wins for me.

    As for csh vs. ksh, let's get into a nice flamewar on vi vs. emacs at the same time since we have nothing better to do and it's never been hashed over before...

    You might not object to vi quite as much if you try vim, Clayton, but I still prefer emacs to either for 98% of my uses. But it's personal taste, since I also prefer ksh scripts to csh scripts.

    ReplyDelete
  8. jdedge,

    When I wrote a script in csh recently, it was because I needed to have both stdout and stderr show up in the piped output of something.

    ReplyDelete
  9. I'm also a fan of MicroEmacs, but I will say that all the Linux systems I've seen recently have either pico or nano installed by default. I'm of the any editor but vi school.

    ReplyDelete
  10. I'd love to see a decent graphical editor on Linux, but I've not seen one.

    Pico and Nano are simply worthless, as programmers editors. No better than Notepad.

    That gnome's gedit doesn't have a workable regex capability I find simply dumbfounding.

    Emacs and vi both work great in a console, but emacs is a bitch to learn, and vi is almost completely undocumented, so hardly anyone actually knows what it can do.

    And vi doesn't have a GUI mode, and the various emacs' GUI modes are simply terrible, from a UI standpoint.

    The editor in Eclipse, of course, has everything I could ask for, but it's got too much baggage to use as a standalone editor.

    So mark me down as another Linux user who has yet to find a editor he really likes.

    Maybe Bluefish?

    ReplyDelete
  11. If you've got X running, ScITE is a pretty nice text editor with syntax highlighting for lots of different languages. It works pretty nicely in Windows, too.

    ReplyDelete