paul_y3k Posted June 18, 2007 Share Posted June 18, 2007 sigh, i've spent the day trying to suss this, and i know it should be easy but I'm falling ...... I've one file that contains a list of numbers .. 1 2 3 All i want to do is read each line into a varible do something with it, then move on to the next line and repeat ... i.e loop X=read line of file touch file.X go back around and end up with file.1 file.2 etc please dont tell me this is awk / sed. They scare me. Quote Link to comment Share on other sites More sharing options...
Alan999 Posted June 18, 2007 Share Posted June 18, 2007 You lost me at the thread title Hope you get sorted mate Quote Link to comment Share on other sites More sharing options...
sdavies Posted June 18, 2007 Share Posted June 18, 2007 lol, I'll dig out my scripting book a bit later if nobody has answered you by the time I get home Quote Link to comment Share on other sites More sharing options...
Jake Posted June 18, 2007 Share Posted June 18, 2007 while read PaulsFile do WhatEverYouLike done Quote Link to comment Share on other sites More sharing options...
paul_y3k Posted June 18, 2007 Author Share Posted June 18, 2007 jake ... i tried rea, but it only takes stuff from standard input not from a file ? if i try your script it just sits there ... Quote Link to comment Share on other sites More sharing options...
Jake Posted June 18, 2007 Share Posted June 18, 2007 "rea"? Did you include the done Quote Link to comment Share on other sites More sharing options...
francis Posted June 18, 2007 Share Posted June 18, 2007 #!/bin/bash for i in `cat yourfile`; do echo "creating file for $i" touch file.$i done That what you're after? Quote Link to comment Share on other sites More sharing options...
paul_y3k Posted June 18, 2007 Author Share Posted June 18, 2007 cheers jake, francis. both working now many thanks Paul Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.