Subject: Re: Samba's smbclient and NetBSD's find
To: Chris Jones <chris@cjones.org>
From: Claude Marinier <claude.marinier@dreo.dnd.ca>
List: netbsd-help
Date: 03/12/2001 08:54:37
Chris,

I tried 'ls' with double quotes. Here are examples.

	$ ls "*.c"
	ls: *.c: No such file or directory

	$ ls *.c
	coperationsfromfortran.c
	first-prime.c

Single quotes do not work any better.

About 'send-pr', I would like more input and confirmation form more people
that this is a good substitute to depth limited 'find'.

Thanks.

On Fri, 9 Mar 2001, Chris Jones wrote:
> On Thu, Mar 08, 2001 at 11:51:10AM -0500, Claude Marinier wrote:
> > This seems to work but there may be ramifications that I have no foreseen.
> > Could someone confirm or deny this?
> >
> > 		if (recurse)
> > 			slprintf(cmd,sizeof(pstring)-1,
> > 				"find . -name \"%s\" -print > %s",p,tmpname);
> > 		else
> > 			slprintf(cmd,sizeof(pstring)-1,
> > 				"ls -1 %s > %s",p,tmpname);
> > //			slprintf(cmd,sizeof(pstring)-1,
> > //				"find . -maxdepth 1 -name \"%s\" -print > %s",p,tmpname);
>
> Except you'd be better off with quotes:
>                                 "ls -1 \"%s\" > %s",p,tmpname);
>
> This will break if the filename pattern has quotes in it, but that's
> no worse than the original code.
>
> Can you send-pr this?

-- 
Claude Marinier, Information Technology Group    claude.marinier@dreo.dnd.ca
Defence Research Establishment Ottawa (DREO)    (613) 998-4901  FAX 998-2675
3701 Carling Avenue, Ottawa, Ontario  K1A 0Z4         http://www.dreo.dnd.ca