Results 1 to 2 of 2

Thread: long echo echo echo...

  1. #1
    Join Date
    Nov 2008
    Location
    Maine
    Beans
    1,125
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question long echo echo echo...

    hi all,
    I have a long stream for an echo command. for ease of reading, I would like to bust up this stream, but not have to recall echo numerous times.
    Code:
    #!/bin/bash
    OUTPUT="$(ddate)"
    echo -e "<html><head><title>Demo</title></head><body>" "<br><h1>Hail Eris!! Hail Discord!</h1><br>"  "Today is $OUTPUT <br>" "<br>Some Useful links:<br>"\n"<br><a href=""http://www.w3schools.com/"" target=""_blank"">Visit W3Schools!</a> <br>""<br><a href=""http://www.google.com/"" target=""_blank"">Google</a> <br>""<br><a href=""http://www.w3schools.com/"" target=""_blank"">Visit W3Schools!</a> <br>""</body></html>"   > index.html
    when all the echo bits are on the same line, this works fine.
    when I want to make a new line, I tried \n even with the -e option, the script wont run. is there a way i can bust this string up for easy reading? all the actual code can be on the same line, i don't care about that, I just want it to be easier to read.
    ~Conradin~

  2. #2
    Join Date
    May 2007
    Location
    East Yorkshire, England
    Beans
    Hidden!

    Re: long echo echo echo...

    Code:
    #!/bin/bash
    OUTPUT="$(ddate)"
    echo -e "
    <html>
      <head>
        <title>Demo</title>
      </head>
      <body>
        <br>
        <h1>Hail Eris!! Hail Discord!</h1>
        <br>
        Today is $OUTPUT <br>
        <br>Some Useful links:<br>
        <br><a href=""http://www.w3schools.com/"" target=""_blank"">Visit W3Schools!</a> <br>
        <br><a href=""http://www.google.com/"" target=""_blank"">Google</a> <br>
        <br><a href=""http://www.w3schools.com/"" target=""_blank"">Visit W3Schools!</a> <br>""
      </body>
    </html>" > index.html
    Website | Blog | The Arch Hurd Project

    If you want to ask about something I posted, send a PM, as I don't watch many threads

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •