From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt H To: 9fans@cse.psu.edu Subject: Re: [9fans] Getting started in Plan9 - help Message-Id: <20020121202829.165a5e90.matt@proweb.co.uk> In-Reply-To: <20020121194211.41F8419981@mail.cse.psu.edu> References: <20020121194211.41F8419981@mail.cse.psu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Mon, 21 Jan 2002 20:28:29 +0000 Topicbox-Message-UUID: 3ff4fc06-eaca-11e9-9e20-41e7f4b1d025 On Mon, 21 Jan 2002 14:42:04 -0500 "David Gordon Hogan" 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