Jump to content

[SOLVED] echo \n


freebsdntu

Recommended Posts

Hi,

 

Im glad to help you, and you should take away your "\n" thats why it is appearing, just leave it:

echo 'Hello World!'

 

Im glad for helping you,

 

if i had solved your problem, mark this thread as solved please

Thank you for your help, but the problem is not solved, i have a series of echo statements, if I remove \n, then there won't be carriage returns.

Link to comment
Share on other sites

the main reason is that you need double quotes to evaluate the caharacters.  if you user "hello world \n"  that will work because it will pringt a new line isntead of a "\" and a "n"

 

gdlk

This sounds rationale, but what if I do it like this : 'Hello Word"\n"', it still does not work.

I guess I need to check with the escape characters. Since I would have "" symbols inside "" of echo

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.