Hi there,
I am a student and currently working on a project. I have a file that contains about 50 filenames. (1.txt, 2.txt, 3.txt ...).
I would like to know how can I store these filenames into a variable using a loop?
I would appreciate if anyone can help me. Thank You.
Regards,
Bib
What exactly are you asking for? Do you want to know how would reaf from the file or what? If so, it depends on the way the names have been stored in the file, if were written with fprintf(), use fscanf() to read them, like:
fscanf(names_fp, "%s %s %s", name1, name2, name3);
Thank You.
My problem has been solved.
Regards,
Bib
jiin
August 10, 2002, 10:26pm
4
Originally posted by hell666
What exactly are you asking for? Do you want to know how would reaf from the file or what? If so, it depends on the way the names have been stored in the file, if were written with fprintf(), use fscanf() to read them, like:
fscanf(names_fp, "%s %s %s", name1, name2, name3);
Hmmm .. that doesn't look like bash to me. Maybe I am just not using the same bash as everyone else.
jiin
FYI.... you shouldn't post homework questions in these forums. Especially not when you haven't made attempts to answer them at all yourself!