GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Homework help! sed + script to append - SIMPLE for you gurus! (https://gfy.com/showthread.php?t=518606)

dirtysouth 09-20-2005 10:34 AM

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! :helpme

psili 09-20-2005 10:44 AM

Code:

cat orig.txt >> target.txt
?

dirtysouth 09-20-2005 11:47 AM

Quote:

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.

AgentCash 09-20-2005 11:54 AM

sed -f more_cd CD_list > new_list

dirtysouth 09-20-2005 11:59 AM

Quote:

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!


All times are GMT -7. The time now is 09:31 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123