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, David Laight wrote:
> > However, it requires the save_args function to be cut and pasted into
> > every script that wants it (or made available via a library of shell
> > functions).
> Easier than getting an extra executuble into $PATH :-)

That depends.

> >     ssh_cmd="$( shquote ssh user@host "$remote_cmd" )"
> ssh is a bad example, I suspect everything needs quoting twice, once
> for the local system and once for the remote one!

That's what makes it a good example!

> So, process each arg and replace every ' with '"'"' and insert inside '.

Yes, sure, I can do that.  My point is that I don't want to write
unreadable code over and over again (and risk getting it wrong) when a
simple utility could do the job.

--apb (Alan Barrett)

Home | Main Index | Thread Index | Old Index