I need a bash script that works on a configuration file that has one entry line by line and looks this way:
For each of the lines a command shall be executed with <entry> inside. In all cases the plus sign at the end is stripped away. If the entry ends with a plus also a second command has to be executed. Here also the <entry> without the plus sign has to be inside. Both commands shall be easily editable but can be hardcoded inside the script.
For each <entry> the start time and end time for the one or two commands has to be taken. In addition an output and error logs has to be created in the form of <entry>[url removed, login to view] and <entry>_error.log. If the second command is run also a <entry>[url removed, login to view] and <entry>[url removed, login to view] has to be created. Furthermore the exit code has to be interpeted for each command if the command went through okay or not and a summary has to be created as csv-file looking this way for all entries:
entry;start timestamp;end timestamp;bool exit code command A;bool exit command B
The bool exit code is either true or false or NULL (if the second command has not been run).
Script shall be started this way:
./<scriptname> -f config-file -l <log_dir> -o <output-csv-file>
Looking forward to your bids.
Décerné à :
Hello. That is quite simple bash script. I can write it within two hours as soon as you accept the project. Feel free to contact me for any questions.