En cours

Simple bash script

Hi,

I need a bash script that works on a configuration file that has one entry line by line and looks this way:

entryA

entryB

entryC+

entryD

entryE+

...

entrySomething

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.

Best regards,

Sebastian

Compétences : Linux, Script Shell, Administration Système

Voir plus : o log n, 30 second script, bash script true false, bash file, bash 0, timestamp, simple csv, null, linux bash script, bool, bash script, output script, run script linux, run command linux, simple forward, run script forward, linux configuration file, linux script log, csv bash, bash script csv, config file simple, config error, run commands, linux run run script, script sign

Concernant l'employeur :
( 53 commentaires ) Fentange, Germany

N° du projet : #1058430

Décerné à :

ClusterStudio

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.

70 $ USD en 0 jours
(23 Commentaires)
4.2

2 freelance ont fait une offre moyenne de 85 $ pour ce travail

phankhanh

Please check your PMB.

100 $ USD en 0 jours
(2 Commentaires)
2.5