string - preserving text format php for UserData -
my problem seems simple stuck.
i have template file has content below:
#!/bin/sh sudo -s; touch /tmp/{{key}}
my requirement have read file replace key
value , pass userdata
input aws php sdk
.
how after running
$key = "{{key}}"; $value ="test1.txt"; $filecontent = file_get_contents($templatepath); str_replace("{{" . $key . "}}", "$value", $filecontent);
to above file content format lost. generates follows
#!/bin/sh sudo -s;touch /tmp/test1.txt
i lost format , sdk not understand bash script
Comments
Post a Comment