How to remove specific characters (like newlines) from {{selection}} variable? #445
Replies: 2 comments
-
|
Hi, there's no builtin way to replace chacters in {{variables}}. Looks like echo {{selection}} | tr -d '\n'
# For GNU version of tr:
echo {{selection}} | tr --delete '\n'Another way could be to put P.S. I'll move this discussion from Ideas to Q&A. |
Beta Was this translation helpful? Give feedback.
-
|
my trick way, but not 100% do well: temp file |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Current Behavior
I'm trying to manipulate the text from the
{{selection}}variable in my shell commands, specifically to remove certain special characters (like newlines). However, I haven't found a clear way to achieve this using shell commands.Expected Behavior
I would like to be able to process the
{{selection}}text to remove specific characters before it's used in the shell command.Questions
{{selection}}variable content?Possible Solutions I've Considered
trcommand (but unsure about the correct syntax with the variable)sed(but need guidance on proper escaping and handling)Technical Details
Examples
What I'm trying to achieve:
Any guidance or suggestions would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions