I
I
Ivan Ivanov2019-11-17 01:50:52
linux
Ivan Ivanov, 2019-11-17 01:50:52

How to pass multiline text as a parameter to a command?

There is a command node /somejs.js arg1 arg2 arg3
How to transfer multiline text to arg1? Because to be:

node /somejs.js "Какой-то\nмногострочный\nтекст" arg2 arg3

When I pass it like this, \n characters appear in the variable in the js script, and not line breaks.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daria Motorina, 2019-11-17
@glaphire

Try answers from SO - idea with cat+heredoc is googled most often

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question