Re: A Tricky quoting problem
From: Paul D. Smith (psmith_at_nortelnetworks.com)
Date: 05/30/04
- Next message: joe_at_invalid.address: "New FAQ item."
- Previous message: Peter J. Acklam: "Re: Loop over files containing spaces"
- In reply to: Alon: "A Tricky quoting problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 May 2004 14:02:40 -0400
%% "Alon" <noSpam@hotmail.com> writes:
a> I Have a quoting problem that I can't solve. I need to make double
a> quote inside single quote inside double quotes.
a> I'm trying to make a catXML alias that will display formatted XML
a> files.
a> The catXML script is ready and working (mixture of sed and awk) but
a> now i'm trying to convert the script to alias.
a> The following does not work:
a> alias catXML "cat \!* | sed -e 's/[ ]*["][ ]*/ABC/g' "
a> I want that eventually:
a> catXML= cat \!* | sed -e 's/[ ]*["][ ]*/ABC/g'
a> How do I do that?
How about, "use a better shell"? This is trivial in any shell with
reasonable and consistent quoting and command parsing rules.
catXML () {
cat "$@" | sed -e 's/[ ]*["][ ]*/ABC/g'
}
%% Later:
>> unset backslash_quote
>> set backslash_quote ; alias catXML 'cat \!* | sed -e \'s/[ ]*["][ ]*/ABC/g\''
a> [ ... doesn't work ... ]
Good grief. I rest my case.
-- ------------------------------------------------------------------------------- Paul D. Smith <psmith@nortelnetworks.com> HASMAT--HA Software Mthds & Tools "Please remain calm...I may be mad, but I am a professional." --Mad Scientist ------------------------------------------------------------------------------- These are my opinions---Nortel Networks takes no responsibility for them.
- Next message: joe_at_invalid.address: "New FAQ item."
- Previous message: Peter J. Acklam: "Re: Loop over files containing spaces"
- In reply to: Alon: "A Tricky quoting problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|