Share ignore and storing % tokens in a tdb

David Collier-Brown davecb at
Mon Jan 31 17:55:20 GMT 2000

Nicolas Williams wrote:
> Is there a function that will safely quote any shell metacharacters in a
> string such that that string can then be placed in double quotes and
> passed to /bin/sh -c?? I think we could use such a function, but I
> wonder how simple it would be.

	I wrote one once for C (actually B!) quotes,
	and it was mildly hairy. 

	Hmmn: or is it???
	I suspect we want to evaluate all the `` and $var
	constructs, so that the program called gets the right
	information, and just protect against tokens like
	"foo bar" turning into multiples...

	Does that make sense? That would make:
		open hook = scriptName %U "weegle woggle" 
	should turn into 
		popen("scriptName \"%U\" \"weegle woggle\"" ,"r");
David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   | //
Work: (905) 415-2849 Home: (416) 223-8968 Email: davecb at

More information about the samba-technical mailing list