Question: How do I save multi-line 'area' text input to a file in tool XML?
gravatar for mrals
15 months ago by
mrals0 wrote:

Hello, I have a plain text input for some data. <param name="foo" type="text" area="True" label="This is Foo"/> I would like to paste the value of this cheetah variable into a file in the command block, something like echo $foo > input.txt; but when I do this, Cheetah replaces each newline of the text input with "__cn__" and each carrot with "__gt__". How do I load this data into a file without using regex?

tool xml dev • 320 views
ADD COMMENTlink modified 15 months ago by Hotz, Hans-Rudolf1.8k • written 15 months ago by mrals0
gravatar for Hotz, Hans-Rudolf
15 months ago by
Hotz, Hans-Rudolf1.8k wrote:


Special characters are sanitized for security purposes. See: ~/lib/galaxy/util/ for all the mapped characters.

Have a look at: for ways to handle this on a per tool basis. However, keep in mind, that passing characters unsanitized is a potential security risk.

Hope this helps Regards, Hans-Rudolf

ADD COMMENTlink written 15 months ago by Hotz, Hans-Rudolf1.8k

Thank you @Hans-Rudolf. I understand the concern, which makes lots of sense in an open-source environment. In my case, the text was more of a config-file for parsing, rather than an executable script (like the awk example that is often featured).

Your link helped solve my problem, as the documentation on mapping helped me turn the newline character into a space, and then a simple echo $mytext | tr ' ' '\n' > $cfgfile statement allowed me to echo the text into the config file by replacing the space with a newline.

edit: tr was simpler than sed.

ADD REPLYlink modified 15 months ago • written 15 months ago by mrals0
Please log in to add an answer.


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