SCRIPT

Have a question for the lug and you are not a member of the mailing list? Or you just want to start a discussion here, go right ahead.

Moderators: snarkout, Patrick, dann

Post Reply
Lauren
Posts: 33
Joined: Tue Jun 01, 2004 8:14 am

SCRIPT

Post by Lauren » Tue Jul 06, 2004 1:37 pm

Hi! Im wondering if theres a script out there to use that will allow me to just pull up, on any pc when ya turn it on, the network drives the company has??

Is there a script out there??

pthread
Posts: 57
Joined: Wed May 05, 2004 12:53 am
Contact:

Post by pthread » Tue Jul 06, 2004 4:01 pm

Ah, now you are getting into one of the coolest parts of linux... scripting. I am sure there is a script out there.. but why not learn a bit about scripting too?

The neat thing about scripting is, all you need is the path to your shell at the top, then regular commands work, plus all sorts of neat logic. By the path to your shell, I mean:

Code: Select all

#!/bin/bash
A simple script could just be you putting the mount command next, the very same one you use on the command line. Now the problem with this is that it means you have to save the password to another computer in plain text on the linux machine. Some people will say this isn't much of a problem, especially if it is made say just executable by root, and not viewable by anyone else. An alternative is that you could allow guest access for the share, but that's no fun either. Maybe someone knows a secure way to do this.

In the end don't forget to make the script executable!

Lauren
Posts: 33
Joined: Tue Jun 01, 2004 8:14 am

script

Post by Lauren » Wed Jul 07, 2004 7:14 am

Ok so the whole "path to my shell" im a bit confused on that....also, maybe you could explain to me the difference between scripting and programming, is there one?

User avatar
mrben
Posts: 124
Joined: Thu Apr 29, 2004 6:25 am
Location: Glasgow
Contact:

Post by mrben » Wed Jul 07, 2004 8:09 am

There is a very fine line between programming and scripting. I'll talk about that in a minute.

If you type in echo $SHELL at your command prompt, it will give you the path to the shell that you are currently using. For most Linux users this is /bin/bash. The 'shebang' (#!) at the top of a text file informs the system the whereabouts of the program to pass the commands to, hence #!/bin/bash


Scripting can be defined in one of a couple of ways, but generally:

Writing an application ('script') using a 'scripting' language - these are usually interpreted rather than compiled. Hence Python, Perl and Bash are all 'scripting' languages, and writing code in them is 'scripting'

I think that scripting would be regarded as a subset of programming, which is, in itself, a subset of 'coding'. Thus Python 'programmers' write Python scripts, which are a form of program, but HTML 'coders' would not necessarily be regarded as programmers.......


Of course, I could be all wrong about this...................
mrBen

Carpe Aptenodytes

JediMoose.org

Lauren
Posts: 33
Joined: Tue Jun 01, 2004 8:14 am

Script

Post by Lauren » Tue Jul 13, 2004 1:00 pm

OK now that i understand scripting vs programming......thanks to everyone!

Is there a script out there that will allow my linux machine to just automatically bring up the shared drives, just like a windows machine does??

Im assuming id need to download samba first, which i have done already but then is there a script out there or how would i go about finding out how to do this??

Thanks!

pthread
Posts: 57
Joined: Wed May 05, 2004 12:53 am
Contact:

Post by pthread » Tue Jul 13, 2004 2:46 pm

This actually seems like it might be the ticket:

http://www.flyn.org/projects/pam_mount/

Post Reply