Re: [galaxy-user] Passing a string with spaces to a tool
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
2009/8/21 Nick Schurch <N.Schurch@dundee.ac.uk>:
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.
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 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__). On Aug 21, 2009, at 5:48, "Nick Schurch" <N.Schurch@dundee.ac.uk> 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-user mailing list galaxy-user@bx.psu.edu http://mail.bx.psu.edu/cgi-bin/mailman/listinfo/galaxy-user
participants (3)
-
Gordon, Assaf
-
James Casbon
-
Nick Schurch