File mode badly shown in smbclient (want DAHR,---R,---- etc)
Joel Hammer
Joel at HammersHome.com
Fri Dec 21 06:34:29 GMT 2001
I think you could just ship the smbclient program. Samba and smbclient are
two distinct animals. Or, if you are more ambitious, and know more than me,
you could ship a doctored version of smblient which would take an additional
command line option that would use the different output string. If I have
the time, likely I won't, I'll play with it.
Joel
On Fri, Dec 21, 2001 at 09:40:47AM +0200, Ralf.Strandell at silja.com wrote:
> Thanks.
>
> However...
> Unfortunately I cannot rely on non-standard versions of software.
> My script will be distributed to a number of people with different versions
> of Samba.
> I could list the latest version of Samba in the requirements, but certainly
> nothing like "recompile required". Thus the problem remains.
>
> ______________________________
> Ralf Strandell
> UNIX Systems Administrator
> Silja Line, Finland
> ______________________________
>
>
> > -----Original Message-----
> > From: Joel Hammer [mailto:jhammer2 at home.com]
> > Sent: 20. joulukuuta 2001 16:51
> > To: samba at lists.samba.org
> > Subject: Re: File mode badly shown in smbclient (want DAHR,---R,----
> > etc)
> >
> >
> > This is a new and improved version of that statement.
> > This should be easy to parse, no matter what awful file name you have.
> > DEBUG(0,(" <%s>(%s)|%.0f|%s",
> > Gives this output:
> > <junkbig.ps>()|31344767|Sat Dec 8 13:00:42 2001
> > <junkbig>()|31344767|Sat Dec 8 13:01:36 2001
> > <opera-6.0-20011129.1-static_qt.i386.tar.gz>()|4081948|Sun
> > Dec 9 21:29:54 2001
> > <opera-6.0-20011129.1-static_qt.i386>(D)|0|Sun Dec 9 21:33:14 2001
> > <lib>(D)|0|Sun Dec 9 21:34:23 2001
> >
> > This is the sed command (very messy) which parses this for you:
> > #!/bin/bash
> > sed "{
> > s/\(
> > *<\)\(.*\)\(>\)\((\)\(.*\)\()\)\(|\)\(.*\)\(|\)\(.*\)$/\"\2\"
> > \"\5\" \"\8\"/
> > }"
> > It doesn't matter if there are embedded < or > in the file
> > name. Sed goes
> > to the last character it can fit into the seach string.
> >
> > This is the output:
> > "junkbig.ps" "" "31344767"
> > "junkbig" "" "31344767"
> > "opera-6.0-20011129.1-static_qt.i386.tar.gz" "" "4081948"
> > "opera-6.0-20011129.1-static_qt.i386" "D" "0"
> > "lib" "D" "0"
> >
> > Ain't open source grand?
> > Joel
> >
> >
> > --
> > To unsubscribe from this list go to the following URL and read the
> > instructions: http://lists.samba.org/mailman/listinfo/samba
> >
More information about the samba
mailing list