last sed question of the week
last sed question lol. ok i have a variable $1. this is a string to search for in a file called temp.
so what i want to do, is have sed go through this temp file, and if it finds $1, i want it to send that to another file called tempmusic. then i'm going to cp tempmusic to music. $1 will be the the full or partial name of a band. like 98 degrees or something. there will be only one band name per line, but there could be many lines per band. so all i need it to do is take $1, and get it into a file called music. again, sed will be reading from the file: temp. I have no idea how to search for a string using $1, cuz i want the contents of it, not a literal $1. also, like if $1 were "Stwain", i want sed to find both Stwain01, and Stwain02. thanks in advance. here is an example file
Stwain01
Stwain02
Efitzgerald
98degrees01
98degrees02
98degrees03
Lwelk
Last edited by sphynx; 04-28-2004 at 05:54 PM.
|