File mode badly shown in smbclient (want DAHR,---R,---- etc)

David Collier-Brown davecb at canada.sun.com
Thu Dec 20 05:31:03 GMT 2001


Ralf.Strandell at silja.com wrote:
> 
> Hi
> 
> We are using smbclient to automatically (& remotely) monitor the sizes and
> ages of files. The file names contain spaces of course. Some files have
> attributes set. Now how do I separate between file attributes and the file
> name in the following directory listing?
> 
> EXAMPLE:
> 
>   smb: Ö> dir *file*
>     second file is called AR                    0  Fri Sep 15 12:37:54 2000
>     file name with spaces             AR        0  Fri Sep 15 12:37:54 2000

	This is easy:
cut -c 1-33 $$ >$$.name
cut -c 34-37 $$ >$$.attr
cut -c 38-46 $$ >$$.size
cut -c 47- $$ >$$.date
paste -d: $$.name $$.attr $$.size $$.date
rm $$

	On the other hand, an option to ls to
	make it use a unix-like notation might
	make good sense. -l, perhaps (:-))

--dave
-- 
David Collier-Brown,           | Always do right. This will gratify 
Americas Customer Engineering, | some people and astonish the rest.
SunPS Integration Services.    |                      -- Mark Twain
(905) 415-2849                 | davecb at canada.sun.com




More information about the samba mailing list