Homework help! sed + script to append - SIMPLE for you gurus!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dirtysouth
    Confirmed User
    • Jul 2003
    • 2613

    #1

    Homework help! sed + script to append - SIMPLE for you gurus!

    So I'm taking a course online and here's what I've got (using puTTy):

    1 file called CD_list that contains the following:

    country:1000:210
    rock:1001:380
    classical:1002:52
    alternative:1003:122
    light rock:1004:151
    light rock:1004:151
    celtic:1005:44
    jazz:1006:62
    soundtracks:1007:32
    soundtracks:1007:32


    Now I created a file called more_cd that contains the following:

    $a\
    hard rock:1008:70\
    misc:1009:22

    ALL I need to do is use sed and a script to append the file CD_list with the contents of more_cd. I get the output on the screen using this:

    sed -f more_cd CD_list

    The problem is that it doesn't SAVE the output to the file CD_list! I have searched for hours and I know this is some elementary shit. PLEASE help a brotha out! I'm goin nuts!
    no sig
  • psili
    Confirmed User
    • Apr 2003
    • 5526

    #2
    Code:
    cat orig.txt >> target.txt
    ?
    Your post count means nothing.

    Comment

    • dirtysouth
      Confirmed User
      • Jul 2003
      • 2613

      #3
      Originally posted by psili
      Code:
      cat orig.txt >> target.txt
      ?
      I have to use sed. Like this:

      Code:
      sed -f more_cd CD_list
      That code outputs the desired results to the screen but doesn't actually merge the 2 files.
      no sig

      Comment

      • AgentCash
        Confirmed User
        • Feb 2002
        • 720

        #4
        sed -f more_cd CD_list > new_list

        Comment

        • dirtysouth
          Confirmed User
          • Jul 2003
          • 2613

          #5
          Originally posted by AgentCash
          sed -f more_cd CD_list > new_list
          Hell yeah! Thanks man. I originally used sed -f more_cd > CD_list and it kept deleting my CD_list file. Thanks a million!
          no sig

          Comment

          Working...