sed help please

Forum Forums General Software sed help please

Tagged: 

  • This topic has 3 replies, 2 voices, and was last updated Jan 17-3:31 pm by to-the-moon.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16612
    Member
    to-the-moon

      hey i need a sed command to take all text from file1 line1 and place the text at the end of file2 line1 – targets are bothe from file to file

      EXAMPLE-FILE-1-LINE-1
      1000

      EXAMPLE-FILE-2 BEFORE PATCH LINE 1
      127.0.0.1:

      EXAMPLE-FILE-2 AFTRER PATCH LINE 1
      127.0.0.1:1000

      please help

      #16613
      Member
      to-the-moon
        Helpful
        Up
        0
        ::

        or any kinda command echo what ever

        #16618
        Forum Admin
        BitJam
          Helpful
          Up
          0
          ::
          line1=$(head -n1 f1)
          sed -i "\$s/$/$line1/" f2

          This assumes the last line of f1 does not contain special characters like “/”. If it does or might then those need to “escaped” between the two lines above.

          Context is worth 80 IQ points -- Alan Kay

          #16622
          Member
          to-the-moon
            Helpful
            Up
            0
            ::

            Thank you so much 🙂 your awesome 🙂

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.