Greetings all!
I'm trying to make it easier for me to mount Windows shares on my Linux box. Currently I can type in something like:
mount -t smbfs -o username=netopia,password=mypass //windowsbox/share /directory/mount_point
I'd like to automate this (and all other smb mounting) with a simple script. If this were DOS, I could make a batch file that had something like the following in it"
mount -t smbfs -o username="%1",password="%2" //"%3"/"%4" /"%5"/"%6"
(or something close to that)
Let's say I called this batch file "mountit.bat". In order to use it, I'd just have to type at the command line:
mountit netopia mypass windowsbox share directory mount_point
and it would parse all those variable into the places I designated.
BUT... I'm not working with DOS. I can't find as simple a way to do this with BASH and I've looked through 3 books now! I know I could build some sort of array and then lookup to insert the varialbes, or do it in PERL (except that I don't know PERL), but I'm hoping there is an elegant solution as would be available in plain old DOS.
Am I looking for something that isn't there?
Thanks,
Joe
I'm trying to make it easier for me to mount Windows shares on my Linux box. Currently I can type in something like:
mount -t smbfs -o username=netopia,password=mypass //windowsbox/share /directory/mount_point
I'd like to automate this (and all other smb mounting) with a simple script. If this were DOS, I could make a batch file that had something like the following in it"
mount -t smbfs -o username="%1",password="%2" //"%3"/"%4" /"%5"/"%6"
(or something close to that)
Let's say I called this batch file "mountit.bat". In order to use it, I'd just have to type at the command line:
mountit netopia mypass windowsbox share directory mount_point
and it would parse all those variable into the places I designated.
BUT... I'm not working with DOS. I can't find as simple a way to do this with BASH and I've looked through 3 books now! I know I could build some sort of array and then lookup to insert the varialbes, or do it in PERL (except that I don't know PERL), but I'm hoping there is an elegant solution as would be available in plain old DOS.
Am I looking for something that isn't there?
Thanks,
Joe