|
From: Nicholas N. <nj...@ca...> - 2003-08-11 13:51:52
|
On 11 Aug 2003, Tom Hughes wrote: > > [~/grind/massif] echo "foo -> bar" | valgrind sed -e 's/^.* -> /b/' > > [ snipped output ] > > > The problem is the spaces in the quoted string; the string gets broken up > > into 3 arguments; this happens in the "valgrind" startup script. I've > > tried to stop this, fiddling with the quotes, using $* instead of $@, but > > it's beyond my understanding of shell quoting rules. Does anyone have any > > suggestions? > > It seems to work for me, which is what I would expect as all the > script is doing is shifting the argument list (although not in this > case as there are switches for valgrind) and then using exec "$@" > which is supposed to preserve the existing word boundaries. You're completely right. My invocation of Valgrind was via a bash function; in that function I was using inappropriate quoting :( Apologies for the distraction, thanks for the correction. N |