Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pause {
- read -p "$*"
- }
- function saveToResultsFile {
- echo "$*" > wynik_bg.txt
- }
- function addToResultsFile {
- echo "$*" >> wynik_bg.txt
- }
- input_file="./00_15_1101_75.out"
- pattern="(?<=\(ev\):).*"
- i=1
- grep -ohP "$pattern" $input_file | while read -r line ; do
- stringarray=($line)
- homo=${stringarray[0]}
- lumo=${stringarray[1]}
- bg=`echo $lumo-$homo | bc -l`
- echo "$i: $bg"
- if [[ $i -eq 1 ]]; then
- saveToResultsFile "$i $bg"
- else
- addToResultsFile "$i $bg"
- fi
- i=$((i+1))
- done
- pause '[Enter pliz]...'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement