tech-userlevel archive

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

Re: Proposal to add /usr/bin/shquote

On Sat, 06 Sep 2008, Aleksej Saushev wrote:
> > I often find the need, in shell scripts, to escape arguments to be
> > passed to other shell commands.  I'd like to add a /usr/bin/shquote
> > command as a simple wrapper around shquotev(3) to do this.
> Why not import real programming language for that? TCL, for instance.

So your solution would be to have my shell script do something like

        listvar="$( tclsh /wherever/somescript arg1 arg2 )"

instead of what I can already do using my own shell function or shell
script (invoking sed(1) and printf(1)), or what I propose to do using a
compiled C program (invoking shquotev(3)):

        listvar="$( shquote arg1 arg2 )"

Your solution would require both writing the tcl script, and importing
tcl to the NetBSD base system.  I don't see that as any simpler than what
I proposed.

--apb (Alan Barrett)

Home | Main Index | Thread Index | Old Index