LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   mounting from list in files? (https://www.linuxquestions.org/questions/programming-9/mounting-from-list-in-files-429755/)

Murdock1979 03-29-2006 03:58 PM

mounting from list in files?
 
Hello!

I am writing a script that reads line by line from files, where each line is a device name that is then mounted.

Is there a way to read each line of the file using script and then check for end of file?

I could do it in C using file handling routines, but it's a fairly simple program that I'd like to keep as a script.


Thanks,
Murdock

ToniT 03-29-2006 04:31 PM

Code:

exec 3< foobar.txt
while read -u 3 foo; do
echo Just had line $foo
done



All times are GMT -5. The time now is 12:41 PM.