JPigford - check the
Rules - I removed your info for instant messages.
It's simple - to do a script you have a choice of shells or languages - choose one that you are use to using (such as the shell you use normally - do a
echo $SHELL to find out what you are using).
Once you have that, cd to your home directory - vi a new file (such as my-new-script)
$ cd
$ vi my-new-script
Insert the commands in the same order you would run them normally from the command line - only difference - add #!/bin/sh or whatever shell you are using at the top - this lets the system know what you are running these commands under
#!/bin/sh
/bin/cp /dirA/* /dirB/*
exit
Then use chmod as suggested to change the script to executable
A script is putting all the commands you usually have to do into a file to run - it's doing what you would do automatically (via cron if needed). The only thing a script does it make it so you don't have to type those commands every time.
Try this on your system:
$ cd
$ vi hbo
i
#!/bin/sh
date +'%n %D %A %T%n'
exit
Hit the escape key, put in a wq to write-quit from the vi editor
$ chmod 744 hbo
$ ./hbo
01/18/05 Tuesday 19:44:04
$
That's all there is to it -