[PATCH] RFC: shell-safe version of string_sub()?

David Collier-Brown David.Collier-Brown at canada.sun.com
Thu Oct 26 12:04:35 GMT 2000


Nicolas Williams wrote:
> You're right about most scripts. In shell scripts one must be religious
> about using double quotes wherever variables are referenced, especially
> if those varfiables may contain "wierd" characters (that includes
> space), unless one is specifically trying to split a variable's value
> (and even then...).

	Just for clarity, you might call it 
	string_sub_requoted instead of _sh, as the user
	would then see that it it just requotes string 
	args, rather than thinking it was all they needed 
	for the shell.

	<ObligatoryHistory> All Multics active functions
	(shell `` operations) did requoting, and there was 
	an explicit active function called requote that did
	nothing else but requote its arguements.
	</ObligatoryHistory>

--dave
-- 
David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   | //www.oreilly.com/catalog/samba/author.html
Work: (905) 415-2849 Home: (416) 223-8968 Email: davecb at canada.sun.com




More information about the samba-technical mailing list