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?
Hi
Special characters are sanitized for security purposes. See: ~/lib/galaxy/util/__init__.py for all the mapped characters.
Have a look at: https://docs.galaxyproject.org/en/latest/dev/schema.html#tool-inputs-param-sanitizer 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
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.