A
A
Asya2020-09-10 13:52:49
bash
Asya, 2020-09-10 13:52:49

How to write text containing quotes and other characters on bash?

how to write

cat << my_FILE > myfile.txt
любой
 текст' " тут< '> с
 \любыми         ""/' ' кавычками

my_FILE


so that bash writes this
any text' "here< '> with \any ""/' ' quotes
without deleting characters?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-09-10
@q2digger


[email protected]:~|⇒ cat test.sh
#!/bin/bash
cat << EOF > aaa.txt
any
text' " here< '> with
\any ""/' ' quotes
EOF
[email protected] :~|⇒ ./test.sh
[email protected]:~|⇒ cat aaa.txt
any
text' " here< '> with
\any ""/' ' quotes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question