[go: up one dir, main page]

Re: Grammar for ls -l output

On 09/01/2026 22:57, Steven Pemberton wrote:
>> May I please use it as a second example [...]
> Of course.

I've done a little editing to create a format suitable for the less 
technical user.

-rw-rw-r-- 1 peter peter    94 Apr 26  2025 acctflaws.aux

now appears as

<file type='normal' links='1' owner='peter' group='peter' size='94' 
month='04' day='026' year='2025'>
   <permissions user='read/write/noexec' group='read/write/noexec' 
other='read/nowrite/noexec'/>
   <name>acctflaws.aux</name>
</file>

...which contains a bug for @day: I was hoping to get this out for 
@MarkupMonday but that's not going to happen.

======================================= 8< ===========================
{iXML representation of the output of the ls -l command}

filelist: space?,file*.
@space: -[L]+,s,n,-#a.
-s: -" "+.
n: ["0"-"9"]+.

file: 
type,permissions,links,owner,group,size,month,day,(year;time),name,-#a.

@type: (-"-",+"normal";
         -"b",+"block special";
 -"c",+"character special";
 -"d",+"directory";
 -"l",+"symbolic link";
 -"p",+"pipe";
 -"n",+"network";
 -"s",+"socket").
{unused: 
C=contigdata,D=door(Solaris),M=offline(Cray),P=port(Solaris),?=other}
permissions: user,group,other,s.

@user:  (-"r",+"read";-"-",+"noread"),
 (-"w",+"/write/";-"-",+"/nowrite/"),
 (-"x",+"exec";-"-",+"noexec";
  -"s",+"setid";-"t",+"sticky").
@group: (-"r",+"read";-"-",+"noread"),
 (-"w",+"/write/";-"-",+"/nowrite/"),
 (-"x",+"exec";-"-",+"noexec";
  -"s",+"setid";-"t",+"sticky").
@other: (-"r",+"read";-"-",+"noread"),
 (-"w",+"/write/";-"-",+"/nowrite/"),
 (-"x",+"exec";-"-",+"noexec";
  -"s",+"setid";-"t",+"sticky").
{unused: S=noxsetid,T=noxsticky}

@links: n,s.

@owner: id.
@group: id.
-id: ~[" "]+, s.

@size: n,s.

@month: (-"Jan",+"01";-"Feb",+"02";-"Mar",+"03";
          -"Apr",+"04";-"May",+"05";-"Jun",+"06";
    -"Jul",+"07";-"Aug",+"08";-"Sep",+"09";
    -"Oct",+"08";-"Nov",+"11";-"Dec",+"12"),s.
@day: -" "?,+"0",["0"-"9"],["0"-"9"]?,s.
@year: n,s.
@time: n,":",n,s.

name: ~[#a]+.

Peter

Received on Monday, 12 January 2026 23:02:50 UTC