9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Matt H <matt@proweb.co.uk>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Getting started in Plan9 - help
Date: Mon, 21 Jan 2002 20:28:29 +0000	[thread overview]
Message-ID: <20020121202829.165a5e90.matt@proweb.co.uk> (raw)
In-Reply-To: <20020121194211.41F8419981@mail.cse.psu.edu>

On Mon, 21 Jan 2002 14:42:04 -0500
"David Gordon Hogan" <dhog@plan9.bell-labs.com> wrote:

> Standard practice in the GNU world.  But is it _good_ practice?

_hopefully_ Russ was being sarcastic

> I had a lot of ``fun'' getting gdb to run on Plan 9 because of this...

There is a lot to be said for a common way of getting text from the kb.

Especially when it removes the burden from application programmers from having to deal with user input in their interactive cli applications.

Of course a better way is to remove the interactive part and just expose the interface

So many times I've typed ls and hit return in MySQL console to get a list of tables instead of "show tables"
Every time I say to myself "if this was plan9 ls would work, and work better" because I could use the usual tools on the output

in fact yesterday I did a LOT of mysql processing using the shell and piping the output into awk & sed to make new queries, something you just can't do in the mysql console

The downside is that I have to pass the username & password on the command line too so it starts to get a bit unwieldy :

mysql -r -B -e "select pages.idx, pages.title, pages2.idx as idx2, pages2.title as title2 from pages left join pages as pages2 on pages.section=pages2.idx where pages2.title like'Car%';" -u USER --password='XXXPASSWORDXXXX' content | sed 's/+//' | awk 'BEGIN {FS="\t"} {printf "mysql -r -B -e \"select body from pageblock where pagesidx=%s ; \" -u USER --password='XXXPASSWORDXXXX' content | tr -d \"\\r\" | sed \"s/^body//\" > \"%s.txt\"\n",
$1, $2}'

I've taken Boyd's advice from ages ago that SQL is mostly pointless and I'm moving my tables into the file system and guess what, the code in my CGI is actually shrinking!

I'm losing some type checking and conforming to legal filenames gets in the way sometimes but on the whole I'm satisfied.

I'm hoping to eventually move the whole app across to plan9 and I'm interested in the fact that by using /n/dump I can backtrack to old data, see where the most activity is and stuff like that.

M



  reply	other threads:[~2002-01-21 20:28 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-21 19:42 David Gordon Hogan
2002-01-21 20:28 ` Matt H [this message]
2002-01-25 10:30   ` Ralph Corderoy
  -- strict thread matches above, loose matches on Subject: below --
2002-01-24 16:30 Russ Cox
2002-01-24 17:34 ` Thomas Bushnell, BSG
2002-01-23 18:24 Russ Cox
2002-01-24  9:38 ` Thomas Bushnell, BSG
2002-01-22 18:28 David Gordon Hogan
2002-01-23 10:04 ` Douglas A. Gwyn
2002-01-23 18:01   ` Thomas Bushnell, BSG
2002-01-23 18:19     ` Ronald G Minnich
2002-01-23 18:21       ` Scott Schwartz
2002-01-24  9:38       ` Thomas Bushnell, BSG
2002-01-23 18:46     ` Boyd Roberts
2002-01-24  9:38       ` Thomas Bushnell, BSG
2002-01-24 13:01         ` David Arnold
2002-01-24 17:35           ` Thomas Bushnell, BSG
2002-01-24 21:40             ` Dan Cross
2002-01-25 10:00               ` Thomas Bushnell, BSG
2002-01-25 22:56                 ` Dan Cross
2002-01-28 18:26                   ` Boyd Roberts
2002-01-29  9:31                     ` Douglas A. Gwyn
2002-01-24 16:05         ` Boyd Roberts
2002-01-24 17:34           ` Thomas Bushnell, BSG
2002-01-25 10:00     ` Douglas A. Gwyn
2002-01-23 10:48 ` Boyd Roberts
2002-01-23 18:01 ` Thomas Bushnell, BSG
2002-01-22  6:44 okamoto
2002-01-22  2:54 dmr
2002-01-22 11:13 ` Boyd Roberts
2002-01-22 17:39   ` Douglas A. Gwyn
     [not found] <20020121170104.2FABD19A05@mail.cse.psu.edu>
2002-01-21 23:30 ` Andrew Simmons
2002-01-21 22:34 erik quanstrom
2002-01-21 22:15 anothy
2002-01-22  9:53 ` Douglas A. Gwyn
2002-01-21 20:39 Russ Cox
2002-01-21 21:16 ` Matt H
2002-01-21 23:39 ` Quinn Dunkan
2002-01-22 15:36 ` cej
2002-01-22 15:42   ` Matt H
2002-01-22 23:02 ` skipt
2002-01-23 10:05   ` Douglas A. Gwyn
2002-01-23 22:28     ` Lyndon Nerenberg
2002-01-21 20:34 presotto
2002-01-21 20:21 Russ Cox
2002-01-21 20:44 ` Mike Haertel
2002-01-21 18:48 Russ Cox
2002-01-21 19:58 ` Mike Haertel
2002-01-21 20:05   ` James A. Robinson
2002-01-21 10:01 Re[2]: " steve.simon
2002-01-21 10:28 ` Boyd Roberts
2002-01-20 21:15 rob pike
2002-01-20 20:02 Roshan James
2002-01-20 21:01 ` Matt H
2002-01-20 22:02   ` Scott Schwartz
2002-01-22  9:54     ` ozan s yigit
2002-01-23 10:05       ` Bakul Shah
2002-01-21 10:22   ` Boyd Roberts
2002-01-21 10:40     ` John Murdie
2002-01-20 21:03 ` William S.
2002-01-20 21:34 ` William Josephson
2002-01-21  6:53 ` cej

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020121202829.165a5e90.matt@proweb.co.uk \
    --to=matt@proweb.co.uk \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).