tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Proposal to add /usr/bin/shquote



Alan Barrett wrote:
On Sun, 07 Sep 2008, Robert Elz wrote:
My only reservation might be that while shell quoting is a very common
need, we also need quoting for other programs -

I was thinking about that when I decided to use getopt to allow for the
possibility of options in future.

But it now seems to me that "shquote" is not a good name for a program
that can also perform non-shell quoting.  Perhaps just "quote" instead
of "shquote"?  It could take a "-t type" option defaulting to "-t sh",
and the initial implementation might not support any types other than
"sh", but the infrastructure could be provided.

the one I see most is for sed patterns - pkgsrc could really do with
that one, when you consider the number of times that it does stuff
like

        sed 's/PREFIX/${PREFIX}/'

Yes, I have also seen and worried about that pattern in pkgsrc.

As long as you are going to go to all this trouble, how about having
a depth option?  Someone alluded to it earlier where the arguments
get scanned once locally and again by a shell at the far end of
an rsh/ssh command.  So, ``-d 2'' would fix this.  Thank you!
Cheers - Bruce


Home | Main Index | Thread Index | Old Index