9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Alex Musolino <alex@musolino.id.au>
To: 9front@9front.org
Subject: Re: [9front] g
Date: Sun, 15 Aug 2021 12:12:37 +0930	[thread overview]
Message-ID: <35B558DC319F335898D178053692880D@musolino.id.au> (raw)
In-Reply-To: <CABB-WO9_BYdBfJeB1sDijoAJ3YPK2X_GGs=d=8XYLwukOE12XA@mail.gmail.com>

> > You don't need to create a new program.  Just specify the awk field
> > separator regex correctly, i.e. -F ': *'.
> 
> For scripting you do - Plan 9 permits tarded filenames.

Well, today I learnt that you can't put tabs in filenames on plan9.  I
suppose I should be proud that I've not tried such a darstadly act
until now.

Even supposing ': ' appears in some filenames, the fact that it does
*not* appear in MIME types means you can still have AWK do the dirty
work.

	file -m * | awk -F: '$NF ~ /^( *)text|application.x-sh/ {
		for(i=1;i<NF;i++){
			if(i>1)
				printf FS;
			printf "%s", $i
		}
		printf "\n"
	}'

I know McIlroy says to write new programs but in this case I think a
-t option for file(1) would be preferable over nfile, if the above
proves to be defeatable.


      parent reply	other threads:[~2021-08-16 10:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 18:03 Stuart Morrow
2021-08-11  1:13 ` ori
2021-08-11 20:15   ` Stuart Morrow
2021-08-11 20:32     ` Stuart Morrow
2021-08-12  5:38       ` Alex Musolino
2021-08-13  2:43     ` Alex Musolino
2021-08-14 21:38       ` Stuart Morrow
2021-08-14 21:45         ` Stuart Morrow
2021-08-15  2:42         ` Alex Musolino [this message]

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=35B558DC319F335898D178053692880D@musolino.id.au \
    --to=alex@musolino.id.au \
    --cc=9front@9front.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;
as well as URLs for NNTP newsgroup(s).