I have xx file into ubuntu machine and I trying to access this file through php script and insert plain text into it . to insert text into this file I used bash file which contain this code
echo $1>> xx
this script will get text which wanted to be insert as parameter and insert it into xx file
to run bash file I used this code in php
header('Content-type: text/plain') ;
echo $txt = 'hello \n how are you \n ';
shell_exec ("sudo /bin/bash /etc/freeradiusbash/append.sh '".$txt."'");
I want to print hello in first line and how are you in second line but the content of xx file is
hello \n how are you \n
how can I tell bash file to print text as plain text