I have a shell script which is supposed to create a file and fill two lines on it (to make it simple).
echo -e "#-*- coding: utf-8 -*-
var1 = ''" > file1.py
This does work, but when I try to put file1.py content in a variable, then it shortens spaces and keeps only one space.
content="#-*- coding: utf-8 -*-
var1 = ''"
echo -e $content > file1.py
🙁 please help
before execution the command is resolved to be:
therefore you just have to quote it again:
which results in: