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. 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 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 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 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 ... 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 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? 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now