replace new line with <br /> & escape special characters
Hi, I wish to replace a new line with br (html) but it doesn't seem to work
Code: Code:
message=$(echo ${FORM_message} | tr '\r' '<br \/>' ) I am also having problem escaping hash sign in cut command: Code:
Code: thanks |
Here is a web page with string manipulation commands that are easy to use.
http://tldp.org/LDP/abs/html/string-manipulation.html |
thanks, but the problem is i dont know which command to use. i m trying everything i can find for example
Code:
message=$(echo ${FORM_message//\r/\<br\>}) |
$'\n' gives a newline character in bash
Code:
FORM_message='line 1 |
I'm pretty sure 'cut' only accepts a single char for the -d option. Try awk or sed or Perl for more complex replacements.
|
thank you
|
All times are GMT -5. The time now is 02:01 PM. |