Find the answer to your Linux question:
Results 1 to 3 of 3
Hello i am making a script that is suppose to automate the use of DNS servers and I am trying to echo the configuration and write it to a specific ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2013
    Posts
    1

    Help with echo


    Hello i am making a script that is suppose to automate the use of DNS servers and I am trying to echo the configuration and write it to a specific file. I am using gedit and this configuration has multiple lines as well as quotes. For example here is part of this:
    echo $TTL 3D
    IN SOA test test(
    1 ; Serial
    1D ; Refresh
    2D ; Retry
    2D ; Expire
    2D ; Negative Cache TTL
    ); > filenamehere
    How would i echo this exactly the way it is to a certain file?
    Thank you

  2. #2
    Linux Newbie
    Join Date
    Nov 2012
    Posts
    226
    hi,

    use quotes
    Code:
    echo "a
    b
    c"

  3. #3
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,410
    A Here document might help
    Here Documents

    However, you might want to have a look at puppet or chef for automation purposes.
    You must always face the curtain with a bow.

  4. $spacer_open
    $spacer_close

Posting Permissions

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