Maybe this will be useful. Output contains also last modification time for the .out file.
The script has three assumptions:
Arguments are names of the output files.
#!/bin/bash
iamhere=$(pwd) # can left this line out
cd /your/working/directory # can left this line out
dos2unix $@
for werqt in $@; do wass=$(grep -c 'Normal termin' $werqt); shouldd=$(grep -c '#' ${werqt%.out}.gjf); echo -e "$werqt: $(tput bold)$wass / $shouldd -> $((shouldd-wass))$(tput sgr0)\t$(ls -l $werqt | xargs | cut -f 6-8 -d ' ')"; tac $werqt | grep -m 2 -B 3 -e '^ #' -e '^ :::' | tac > sneg.foo; routeklis=$(sed -n '/^ #/ {/\\/!{:bulka N; s/\n //g;/---/!b bulka; s/-//g;p}}' sneg.foo); echo -e "Last route/title is:\n$routeklis\n$(sed -n '/^ :::/ {/\\/!{:bulka N; s/\n //g;/---/!b bulka; s/-//g;p}}' sneg.foo)"; [ $(echo $routeklis | grep -c -e ' Opt' -e ' opt') -gt 0 ] && echo "As for now, step $(tac $werqt | sed -n '1,/Normal termin/p' | grep -c 'Step number') is being done."
echo
done
rm sneg.foo
cd $iamhere # can left this line out
An example result (the script is named howresults):
$ howresults IN_436_M062X_plus_DL2_2_U1.out
IN_436_M062X_plus_DL2_2_U1.out: 0 / 164 -> 164 Jun 23 19:17
Last route/title is:
#N MaxDisk=250GB M062X/6311G(d,p) Opt=(CalcAll,NoRaman,MaxStep=1) Volume=Tight Guess=Mix scrf=(cpcm,solvent=TetraHydroFuran)
::: IN17_436_M062X_ufg_6311_thf IN17_436_M062X_6311_thf GeometryOptimization GeomOpt GeometryOptimization 2
As for now, step 10 is being done.
The script has three assumptions:
- title section is marked by initial ::: — we usually have the title section with some certain word fields for automated processing of files and getting them to the database;
- the output file is named same as the input file, only with different extension (.out instead of .gjf);
- the working directory should be specified in the third line of the script, or within the file name; or You can left out the lines remembering present directory, changing to the working directory and going back in the end.
Arguments are names of the output files.
#!/bin/bash
iamhere=$(pwd) # can left this line out
cd /your/working/directory # can left this line out
dos2unix $@
for werqt in $@; do wass=$(grep -c 'Normal termin' $werqt); shouldd=$(grep -c '#' ${werqt%.out}.gjf); echo -e "$werqt: $(tput bold)$wass / $shouldd -> $((shouldd-wass))$(tput sgr0)\t$(ls -l $werqt | xargs | cut -f 6-8 -d ' ')"; tac $werqt | grep -m 2 -B 3 -e '^ #' -e '^ :::' | tac > sneg.foo; routeklis=$(sed -n '/^ #/ {/\\/!{:bulka N; s/\n //g;/---/!b bulka; s/-//g;p}}' sneg.foo); echo -e "Last route/title is:\n$routeklis\n$(sed -n '/^ :::/ {/\\/!{:bulka N; s/\n //g;/---/!b bulka; s/-//g;p}}' sneg.foo)"; [ $(echo $routeklis | grep -c -e ' Opt' -e ' opt') -gt 0 ] && echo "As for now, step $(tac $werqt | sed -n '1,/Normal termin/p' | grep -c 'Step number') is being done."
echo
done
rm sneg.foo
cd $iamhere # can left this line out
An example result (the script is named howresults):
$ howresults IN_436_M062X_plus_DL2_2_U1.out
IN_436_M062X_plus_DL2_2_U1.out: 0 / 164 -> 164 Jun 23 19:17
Last route/title is:
#N MaxDisk=250GB M062X/6311G(d,p) Opt=(CalcAll,NoRaman,MaxStep=1) Volume=Tight Guess=Mix scrf=(cpcm,solvent=TetraHydroFuran)
::: IN17_436_M062X_ufg_6311_thf IN17_436_M062X_6311_thf GeometryOptimization GeomOpt GeometryOptimization 2
As for now, step 10 is being done.
No comments:
Post a Comment