Results 1 to 3 of 3
Dear all,
How does a shell script work whith related t program execution.
Ex: when i have to delete a bunch of files before a backup. Will the backup commands ...
- 07-30-2009 #1Just Joined!
- Join Date
- Apr 2009
- Posts
- 17
shell scripts
Dear all,
How does a shell script work whith related t program execution.
Ex: when i have to delete a bunch of files before a backup. Will the backup commands fired AFTER the files are removed using the rm command or should i check the exit status of the rm command before i do the backup?
rm ./*.log
tar cvf ./backup.tar ./*
How can i make sure the tar command is executed after the rm command?
cheers
- 07-30-2009 #2
In relation to time the rm command will run and complete (either successfully or with an error) and then the tar command will be executed. They will not run at the same time
However, in programming terms it would be a good idea to check that the rm command completed successfully before you tar as error checking will stop any problems occurring later due to previous errorsLinux User #453176
- 07-30-2009 #3Just Joined!
- Join Date
- Apr 2009
- Posts
- 11


Reply With Quote
