mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stuart Young <sgy@amc.com.au>
To: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: Re: Yet another design for /proc. Or actually /kernel.
Date: Thu, 08 Nov 2001 14:07:10 +1100	[thread overview]
Message-ID: <5.1.0.14.0.20011108133358.009fcaa0@mail.amc.localnet> (raw)
In-Reply-To: <20011108012051.C568@blu>
In-Reply-To: <6CAC36C3427CEB45A4A6DF0FBDABA56D59C91D@umr-mail03.cc.umr.edu> <6CAC36C3427CEB45A4A6DF0FBDABA56D59C91D@umr-mail03.cc.umr.edu>

At 01:20 AM 8/11/01 +0100, antirez wrote:
>put every string inside () and only quotes ( and ) with \
>and quotes \ itself with \\, than use brackets to delimit
>string _and_  provide information about the format:
>
>((dev/hda1)(/home/mbrennek/stuff and)(vfat)(rw)(0)(0))
>((/dev/hda2)(/var/tmp)(ext2)(rw)(0)(0))

Now that is just really annoying, and hardly useful.

Why not just allow the user to specify what the field separation character 
is. If the entry/file is opened for writing, then the data passed to it is 
used as the separator. If it's opened in read, just output as normal.

So if say /proc/kernel/foo normally exports...

bar-a1  bar-a2  bar-a3
bar-b1  bar-b2  bar-b3
[===>         ] 40%

...and you pass a colon ":", it spits out...

bar-a1:bar-a2:bar-a3
bar-b1:bar-b2:bar-b3
40

This allows the user to make the choice. If they use the wrong character, 
they can always change it. If they don't specify one, they get the default 
output (which is what existing scripts will expect). From a code 
perspective, you should only need to make all your separators (formatting) 
as variables in the code, and substitute the separator character(s) if 
there is one that's been passed, and just drop the remaining 'pretty' 
garbage totally.

Also means you can easily use command line tools like cut (-d option), 
readline (the read function in bash, and the $IFS variable), and so on, to 
parse the data, quickly and effectively.


AMC Enterprises P/L    - Stuart Young
First Floor            - Network and Systems Admin
3 Chesterville Rd      - sgy@amc.com.au
Cheltenham Vic 3192    - Ph:  (03) 9584-2700
http://www.amc.com.au/ - Fax: (03) 9584-2755


  parent reply	other threads:[~2001-11-08  3:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-07 21:13 Brenneke, Matthew Jeffrey (UMR-Student)
2001-11-08  0:00 ` H. Peter Anvin
2001-11-08  0:20 ` antirez
2001-11-08  0:32   ` H. Peter Anvin
2001-11-08  0:54   ` David Ford
2001-11-08  1:10     ` antirez
2001-11-08  1:26       ` H. Peter Anvin
2001-11-08  1:51         ` antirez
2001-11-08  0:44 ` Stephen Satchell
2001-11-08  1:04   ` antirez
2001-11-08  0:55 ` Jonathan Lundell
2001-11-08  3:07 ` Stuart Young [this message]
     [not found] <w_knop@hotmail.com>
2001-11-07 19:41 ` William Knop
2001-11-08  0:27   ` John Levon
2001-11-08  8:56     ` Erik Hensema
2001-11-08 10:00   ` Remco Post
2001-11-09 16:44     ` Ricky Beam
2001-11-12 13:31       ` Horst von Brand
2001-11-12 14:31         ` Martin Dalecki
  -- strict thread matches above, loose matches on Subject: below --
2001-11-07 19:09 Erik Hensema
2001-11-07 19:27 ` Alan Cox
2001-11-07 19:42 ` Daniel R. Warner
2001-11-07 22:35   ` Allen Campbell
2001-11-07 20:58 ` H. Peter Anvin
2001-11-07 21:19   ` Justin A
2001-11-07 23:44 ` Rusty Russell
2001-11-08  0:35 ` Stephen Satchell

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=5.1.0.14.0.20011108133358.009fcaa0@mail.amc.localnet \
    --to=sgy@amc.com.au \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®