Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
quoting inline args
System
I have this inline element in my DCT:
<inline command='/tmp/test.ipl 1 "2 two" 3'/>
The script contains only:
open( FILE, '>/tmp/file.txt' );
foreach my ${arg} ( @{ARGV} )
{
print FILE ${arg} . "\n";
}
close( FILE );
After running this the file contains:
1
"2
two"
3
Why the linefeed? It's like it treats the quotes as part of the arguments. I have tried a few quoting options but nothing seems to work.
Find more posts tagged with
Comments
Migrateduser
It's another argument since there's a space. Try instead of the space and your problem will be solved.
Probably not the solution you're looking for.
- Jason
Migrateduser
But is not valid XML and &nbsp; gives:
1
"2 two"
3
Migrateduser
Well, that's progress... You got the right number of arguments. I can think of a workaround/kludge to solve your problem if you can't figure out another way....
<inline command='/tmp/convert.ipl 1 "2&nbsp;two" 3'/>
convert.ipl takes in all of the args, converts the to spaces and then calls the test.ipl script with the correct arguments including strings with spaces in them.
Like I said, a kludge, but it'll solve the issue.
- Jason
Migrateduser
I think putting something like & (which is not likely to show up on the command line) and translating in the script is OK, but coding an item label in the DCT is not handy. May resort to config files.
bturns
Have you tried?
<inline command="/tmp/test.ipl 1 '2 two' 3"/>
Migrateduser
invalid xml
Adam Stoller
What's invalid about that idea?
The attribute value is quoted (with double-quotes) and contain an inner-quoted item (with single-quotes).
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
oh sorry, must have read your doublequotes as single quotes. THis is probably one of the first things I tried - are you saying it works for you?
Adam Stoller
I'm not trying to make any of this work - I was just commenting on your response to the posted suggestion - which, as I said, was not invalid XML. Whether it works or not ... well, that's another question. (Personally, I'd try using single-quotes for the attribute value and double-quotes on the inside for the parameter value)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Hans
I can confirm that <inline command="/tmp/test.ipl 1 '2 two' 3"/> or reversing the order of nested single/ double quotes does not work for us (TS6.0 on solaris 8). Don't know why, using " doesn't work either.
So we are using underscore to link param elements together and reconverting back to spaces in the script.
This workaround is similar to proposed &nbsp; but would definitely prefer just using double/single quotes. We need to find a solution for other scripts where underscore or kludges are inconvenient.
Anyone have any ideas?
thanks,
Hans
Adam Stoller
The only other "trivial" suggestion would be to try escaped quotes:
<inline command="/tmp/foo.ipl \"1 and 2\""/>
but I can't say I hold much optimisim in that working. The issue here is how the underlying engine processes the information for invoking the command. I'd suggest contacting Support and opening a case for this - as I think it *should* be possible to do this without requiring the developer to kludge things.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com