0

I am trying to write an template of an INI file from a bash variable into a file using an bash script.

My template INI looks something like this:

$iniTemplate="
[StdDefs]
RemotePath=/opt/myapp
MountPoint=/mnt/store1
Version=1.0.X

[Alpha]
FlagDCA=ENABLE
TlmServer=10.54.3.22"

echo $iniTemplate > myIni.ini

What is wrong with this script that is not generating correctly the INI file? In the powershell I have a similar implementation that uses @" and @" to store a multiline string variable.

I also tried something like this but it did not work

read -r -d '' iniTemplate << EOM
[StdDefs]
RemotePath=/opt/myapp
MountPoint=/mnt/store1
Version=1.0.X

[Alpha]
FlagDCA=ENABLE
TlmServer=10.54.3.22
EOM

Best regards,

F.Borges

fborges22
  • 163
  • 11

0 Answers0