energymedia Posted June 2, 2004 Report Share Posted June 2, 2004 I have just been tasked with mounting a folder from numerous workstations onto the server so that the info in there can be backed up to tape. I know the commands that I wish for this. I am new to scripting in linux and wonder how I would make this an executable script. Example: I would like to be able to run a command/script called PCMOUNT which would then execute the following: smbmount //laptop/archive /home/archive/laptop rw smbmount //pc1/archive /home/archive/pc1 rw smbmount //pc2/archive /home/archive/pc2 rw Also, I would want to be able to create a script that would unmount them. Long story short, how would I make the file an executable? Quote Link to comment Share on other sites More sharing options...
Michel Posted June 2, 2004 Report Share Posted June 2, 2004 (edited) Put the commands in a file and put at the top of the file #!<path to your favorite shell> so for example #!/bin/bash Make the file executable and call it like an executable file .... The commands will be executed by the the command-interpreter (I believe) (here a shell) you specified. I think this is all. I'm not a big expert in this, so others could add some stuff :). Edited June 2, 2004 by Michel Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.