Question: Re: Passing A String With Spaces To A Tool
0
gravatar for Nick Schurch
9.3 years ago by
Nick Schurch • 50
Nick Schurch • 50 wrote:
Dear Galaxy-gurus, How can I pass a string with spaces as a parameter from the galaxy interface to a tool that I've written myself in perl? I've tried enclosing the string with quotes (single and double) and various escape characters and all they do is add __dq/sq/X__ to the start of the string and then ignore everything else after the space. my xml looks like: <tool id="blah" name="mytool"> <command interpreter="perl"> /pathto/mycommand.pl -str $str </command> <inputs> <param name="str" type="text" label="Put your string here"/> The kind of commandline i'm looking for this to generate is.... perl mycommand.pl -str "this is my string" but currently it just gives perl mycommand.pl -str this or perl mycommand.pl -str __dq__this or perl mycommand.pl -str X__dq__this Thanks! -- Cheers, Nick Schurch Data Analysis Group (The Barton Group), School of Life Sciences, University of Dundee, Dow St, Dundee, DD1 5EH, Scotland, UK Tel: +44 1382 388707 Fax: +44 1382 345 893
galaxy • 981 views
ADD COMMENT • link • modified 9.3 years ago by Assaf Gordon • 320 • written 9.3 years ago by Nick Schurch • 50
0
gravatar for Assaf Gordon
9.3 years ago by
Assaf Gordon • 320
United States
Assaf Gordon • 320 wrote:
Add single quotes to the XML variable $str : <command> mycommand.pl -str '$str' </command> Then, spaces from the web interface will be preserved (single quoted, double quoted and other 'potentially unsafe' characters will still be converted into __sq__).
ADD COMMENT • link written 9.3 years ago by Assaf Gordon • 320
0
gravatar for James Casbon
9.3 years ago by
James Casbon • 370
James Casbon • 370 wrote:
2009/8/21 Nick Schurch <n.schurch@dundee.ac.uk>: If you trust your users you can add the option name to NEVER_SANITIZE in lib/galaxy/utils/_init_.py There's probably a better way! cheers, James
ADD COMMENT • link written 9.3 years ago by James Casbon • 370
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 178 users visited in the last hour