#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    166
    Rep Power
    15
    I need to write a simple shell script that executes commands (that a cron job will then run):

    1. copy some files
    2. tar these files
    3. zip these files
    4. email me the .zip file
    5. delete tar file
    6. delete zip file
    etc.,

    I want to ensure that each command is executed only after the previous command is completely finished.

    1. Are commands in shell scripts executed sequantially as I want or do I have to add some operator to check completion of prvious task?
    2. Do I need to "quote" the commands or will just specifying the command interpreter and the commands be enough?

    Many thanks

    David
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Indiana
    Posts
    614
    Rep Power
    15
    Well, I think it's run sequentially, but don't quite me on it.

    I think that if you just use something like this:

    cp /blah/blah.txt /test/balh.txt
    tar ....

    You wont need to use any quotes.

IMN logo majestic logo threadwatch logo seochat tools logo