LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux scripting (https://www.linuxquestions.org/questions/linux-newbie-8/linux-scripting-166867/)

Cybercool 04-06-2004 10:22 AM

Linux scripting
 
I want to make a script, that makes directory's en copy's files, when I execute it!!

My Linux distribution is Debian!!

Does anyone know how to set up a script like that??

(with "nano" or so"


Thanks

Cybercool

mikshaw 04-06-2004 10:43 AM

Yes!!

It's something like this!!

#!/bin/sh
mkdir -p /path/to/new/directory
cp /name/of/file /new/destination/of/file

Isn't that easy??

Now, if you'd like more specific help, please explain a little more about what you mean by "makes directory's en copy's files".

Cybercool 04-07-2004 02:10 AM

And how do I run the script???

Does it need a special program??

Cybercool

rob-n 04-07-2004 07:31 AM

in terminal type sh yourscript or ./yourscript

but first cd into the dir of the script.

verstapp 04-07-2004 08:13 AM

You also have to type
chmod u+x <scriptname>
to make the script an executable file. You can most probably do this in your file browser window (in Suse konquerer: right-click on file, Properties menu option, permissions tab, click the user exec tickbox to put an X in there).

For anything else to do with scripting, start by typing 'bash tutorial' into google.

rob-n 04-16-2004 01:57 AM

to make things simpler, put your script in /usr/local/bin, and then you can run it as a command


All times are GMT -5. The time now is 07:03 PM.