Script to mount directories listed in a file.
Page 1 of 1

Author:  ddrfreak [ Fri Jan 25, 2008 3:50 pm ]
Post subject:  Script to mount directories listed in a file.

I need help writing a script.

What I need to do is take a file which has a list of directories that I need to mount and feed that into a bash script. Any ideas?

ex: mount $MNTDIR /mnt/script mount

And the $MNTDIR would come from a file that lists a bunch of directories. Of course it would go in a loop and mount them all. I just don't know how to get a variable from a file

Author:  DarthWavy [ Tue Jan 29, 2008 6:12 am ]
Post subject: 

It's not very clear what you're after, however to loop through the contents of a file you can use the following.

while read myline
  # some operations here
  # $myfile contains each line in turn of the inputfile
done < inputfile

Page 1 of 1 All times are UTC - 6 hours
© 2000, 2002, 2005, 2007 phpBB Group •