Yanndewael
Programmer
Hello,
I want to write a script with several command, example:
#1
Command 1
#2
Command 2
#3
Command 3
...
I will test the return code of these command and exit the script in case of error. After having investigate the error causes, I want to be able to re-execute the script from the failed command.
Example: if command 3 failed, I'd like to execute "Script 3" and it will not execute command 1 and 2 anymore...
How can I manage? I think to test the parameter before each command: if this parameter is < the command number -> skip.
But this implies to test the parameter before each command and we will loose in clarity.
Any other idea?
Thank you in advance,
Yann
I want to write a script with several command, example:
#1
Command 1
#2
Command 2
#3
Command 3
...
I will test the return code of these command and exit the script in case of error. After having investigate the error causes, I want to be able to re-execute the script from the failed command.
Example: if command 3 failed, I'd like to execute "Script 3" and it will not execute command 1 and 2 anymore...
How can I manage? I think to test the parameter before each command: if this parameter is < the command number -> skip.
But this implies to test the parameter before each command and we will loose in clarity.
Any other idea?
Thank you in advance,
Yann