[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Proposal to add /usr/bin/shquote
On Sat, Sep 06, 2008 at 05:06:55PM +0200, Alan Barrett 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
Easier than getting an extra executuble into $PATH :-)
> 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!
So, process each arg and replace every ' with '"'"' and insert inside '.
local a n v IFS;
v=; n=$1; shift
for a; do
IFS="'"; set -- $a; IFS=
while [ $# -gt 1 ]; do
David Laight: david%l8s.co.uk@localhost
Main Index |
Thread Index |